在我的网站上,我实现了一个jquery代码,根据网址关闭CSS菜单的类别:
$(document).ready(function(){
$('.workopen').click(function(e){
$(this).siblings('.open').addBack().toggleClass('open');
e.stopPropagation();
});
if (window.location.href.indexOf("glorious.html") > -1) {
$('.work .workopen .four').siblings('.open').addBack().toggleClass('open')}
});
我想添加一些JQuery来改变CSS,以便将特定的Div更改为“display:none;”如果上面的索引是“glorious.html”。这可能是一个非常简单的修复,但我对JQuery的了解有限:/ help?
答案 0 :(得分:0)
$('.workopen').click(function(e){
$(this).siblings('.open').addBack().toggleClass('open');
e.stopPropagation();
});
if (window.location.href.indexOf("glorious.html") > -1) {
$('.work .workopen .four').siblings('.open').addBack().toggleClass('open')}
$('#div1').css("display","none"); //# is used for id and . is used for class
});