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

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -