当项目到达"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});发布于 2014-07-19 17:56:27
如果您想关闭粘性,请尝试如下:
jQuery("#gformdiv").hcSticky('off');在您的例子中,您编写了错误的语法。应该是这样的:
隐藏:
jQuery("#gfoptions").css({display:"none"});或
jQuery("#gfoptions").hide();展示:
jQuery("#gfoptions").css({display:"block"});或
jQuery("#gfoptions").show();发布于 2014-07-19 17:57:53
只需使用隐藏和显示
$( ".target" ).hide(); //adds the css style display none
$( ".target" ).show(); // removes the css style display none attribute https://stackoverflow.com/questions/24843024
复制相似问题