Element not fadingOut

感情迁移 提交于 2019-12-25 03:04:39

问题


I have 2 divs, that need to fade out once the element called "container" is visible, the problem is one of the elements, "navigation" fades out fine like its suppose to, but the element "backtotop" just seems to hide without a fade out.

I am not sure why this is happening, even if i put .fadeOut(3000) the element just delays before hiding, without fading out.

var startY = $('#container').position().top + $('#container').outerHeight();

$(window).scroll(function(){
checkY();
});

function checkY(){
if( $(window).scrollTop() > startY ){
    $('#backToTop, #navigation').fadeIn(600);
}else{
    $('#backToTop, #navigation').fadeOut(600);
}
}

checkY();

来源:https://stackoverflow.com/questions/13150396/element-not-fadingout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!