Could anyone help me with this JavaScript?
I want a div to show when you scroll down over 1000 pixels, currently it works with the script below but it shows instantly when scrolled.
I tried setting it to >1000 and it doesn’t show at all?
Any ideas?
$(window).scroll( function(){
/* Check the location of each desired element */
$('.hideme').each( function(i){
/* If the object is completely visible in the window, fade it in */
if ($(this).scrollTop() < 1000){
$(this).animate({'opacity':'1'},900);
}
});
});
Hopefully this will help?
I’ve changed the functionality slightly, hopefully you’ll know what to do 😉