Javascript page scrolls automatically up and down

I’m struggling with a challenge that is just a bit out of my skill range. I’m trying to make a page scroll (very slowly) up and down on an infinite loop. I got the code to loop once, but my challenge is to make it loop over and over again. I would love advice.

do {
$(document).ready(function(){
     $('body,html').animate({scrollTop: 2650}, 57820);
  
});

$(document).ready(function(){
     $('body,html').animate({scrollTop: 0}, 35000);
  
});
}
while (true === true);

13 thoughts on “Javascript page scrolls automatically up and down”

Leave a Comment