问题
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