Reputation: 1
I want to fade out a div on scroll with jquery. When it fades out it directly fades back in. It only has to fade back in when its less than 20. Otherwise stay hidden.
Any ideas what i'm doing wrong?
$( window ).on("load", function() {
$(window).scroll(function() {
if ($(this).scrollTop()>20)
{
$("#intro").fadeOut();
}
else
{
$('#intro').fadeIn();
};
});
});
Upvotes: 0
Views: 23