I'm trying to hide an image after I scroll down my page.(向下滚动页面后,我试图隐藏图像。)
When scrolling my header
gets a class fl-theme-builder-header-scrolled
.(滚动时,我的header
会得到一个fl-theme-builder-header-scrolled
。) My image div has a class hiding-image
and I want to add a class image-off
when the fl-theme-builder-header-scrolled
class shows up in the header
.(我的图像div有一个hiding-image
类类image-off
当fl-theme-builder-header-scrolled
类出现在header
时,我想添加一个类image-off
。) This is what I have:(这就是我所拥有的:)
$(document).ready(function() {
if($( 'header' ).hasClass( 'fl-theme-builder-header-scrolled' )) {
$( '.hiding-image' ).toggleClass( 'image-off' );
}
});
but this doesn't work.(但这不起作用。) Any advice?(有什么建议吗?) Thx.(谢谢。)
ask by Chris Osiak translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…