Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var slides = 4;
- var current = 1;
- var duration = 7000; // Milliseconds
- function slide(){
- document.getElementById("slide"+current).style.animation = "slide_backward 2s infinite";
- current+1;
- if(current > slides) current = 1;
- document.getElementById("slide"+current).style.animation = "slide_forward 2s infinite";
- setTimeout(slide(),duration);
- }
- setTimeout(slide(),duration);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement