Is it possible with jQuery to scroll down (with animation, not instant) as long as a certain variable is (not) met?
Example:
  var scroll = 100;
  while (scroll > 0) {
   //Scrolldown code here()
    scroll--;
  }
Is it possible with jQuery to scroll down (with animation, not instant) as long as a certain variable is (not) met?
Example:
  var scroll = 100;
  while (scroll > 0) {
   //Scrolldown code here()
    scroll--;
  }
 
    
    you mean something like:
var i = 0;
while(i < 1000)
{
window.scrollTo(0, i);
i++;
}
The scrolling however will be instant since the loop loops almost instantly
 
    
    jQuery(document).scroll(function() {
 var a = jQuery(this).scrollTop();
 while(a > 120 ){
     //dosomething;
 } 
}); 
