Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
- <script>
- var work = $('body');
- var backgrounds = new Array(
- 'url(img/contentbackground1.jpg)'
- , 'url(img/contentbackground2.jpg)'
- , 'url(img/contentbackground3.jpg)'
- , 'url(img/contentbackground4.jpg)'
- );
- var current = 0;
- function nextBackground(){
- current++;
- current = current % backgrounds.length;
- work.css('contentbackground1', backgrounds[current]);
- }
- setInterval(nextBackground, 1000);
- work.css('contentbackground1', backgrounds[0]);
- </script>
Add Comment
Please, Sign In to add comment