jquery - Destroy the effect when I scrolling down -
$( window ).load(function() { if ($(window).scrolltop() == 0) { $('#girl').delay(4000).fadeout(4000); $('#new_girl').fadein(500); } else{ } });
when load page , scroll down after 4s function works fine when load page , start scrolling when page load works again. want that, if scroll down without waiting 4 seconds, destroy function.may logic should set in else statement. thanks...
$( window ).load(function() {
indicates code inside execute when window
loaded
so must have wait.
what can write code
if ($(window).scrolltop() == 0) { $('#girl').delay(4000).fadeout(4000); $('#new_girl').fadein(500); } else{ }
and make sure jquery included before code
maybe js error if elements id #girl
, #new_girl
not loaded dom
Comments
Post a Comment