Advertisement
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 backgroundUrls = [
- 'img/contentbackground1.jpg',
- 'img/contentbackground2.jpg',
- 'img/contentbackground3.jpg',
- 'img/contentbackground4.jpg'
- ];
- var currentBackgroundIndex = 0;
- function setNextBackground () {
- work.css('background-image', 'url(' + backgrounds[currentBackgroundIndex] + ')');
- currentBackgroundIndex++;
- }
- setNextBackground();
- setInterval(currentBackgroundIndex, 1000);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement