Auto-Rotate Code


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // START ROTATE CODE
  2. var timer;
  3. var donext = function (x){
  4.  
  5. // "Next Slide" code goes here
  6.  
  7. }
  8.  
  9. var dotimer = function (){
  10.  
  11. if(timer != null) {
  12. clearInterval(timer);
  13. }
  14.  
  15. timer = setInterval(function() {
  16. donext();
  17. }, 6000); // Change the time in between rotations here (in milliseconds)
  18.  
  19. }
  20.  
  21. dotimer();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.