如何修改此代码,以便在元素到达“top:45”时隐藏 ID“#gfoptions”?
jQuery(function(){
jQuery("#gformdiv").css('z-index','99999').hcSticky({noContainer:true, top:45});
jQuery(".media-modal").css('z-index','999999');
});
我尝试添加这一行,但没有成功:
jQuery("#gfoptions").css({display: none});
最佳答案
如果你想关闭粘性,试试这个:
jQuery("#gformdiv").hcSticky('off');
在您的情况下,您编写了错误的语法。应该是这样的:
隐藏:
jQuery("#gfoptions").css({display:"none"});
或
jQuery("#gfoptions").hide();
显示:
jQuery("#gfoptions").css({display:"block"});
或
jQuery("#gfoptions").show();
关于javascript - 如何向此 "display none"jquery 脚本添加 "hcsticky"选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24843024/