Guest User

Untitled

a guest
Jan 24th, 2017
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  2.     <script>
  3.         var work = $('body');
  4.        
  5.         var backgrounds = new Array(
  6.             'url(img/contentbackground1.jpg)'
  7.           , 'url(img/contentbackground2.jpg)'
  8.           , 'url(img/contentbackground3.jpg)'
  9.           , 'url(img/contentbackground4.jpg)'
  10.         );
  11.        
  12.         var current = 0;
  13.            
  14.         function nextBackground(){
  15.             current++;
  16.             current = current % backgrounds.length;
  17.             work.css('contentbackground1', backgrounds[current]);
  18.         }  
  19.         setInterval(nextBackground, 1000);
  20.        
  21.         work.css('contentbackground1', backgrounds[0]);
  22.     </script>
Add Comment
Please, Sign In to add comment