Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. //And manually call update once or at initial loading
  2. //E.g. in jquery: $(document).on("load", update);
  3. update();
  4.  
  5. setInterval(update, 2500);
  6.  
  7. function update()
  8. {
  9. for (var i = 0; i < slides.length; i++) {
  10. slides[i].style.opacity = 0;
  11.  
  12. }
  13. slides[current].style.opacity = 1;
  14. current = (current != slides.length - 1) ? current + 1 : 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement