Advertisement
yotis

Web page rotation

Feb 13th, 2013
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.91 KB | None | 0 0
  1. <!-- Rotate web page code ! Not my code, just found on the Internet -->
  2.  
  3.  
  4. <html>
  5. <head>
  6.   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  7.   <script type="text/javascript" charset="utf-8">
  8.     var sites = [
  9.       "http://www.nanog.org",
  10.       "http://www.firstdigest.com/",
  11.       "http://www.cisco.com"
  12.     ];
  13.     var currentSite = sites.length;
  14.  
  15.     $(document).ready(function () {
  16.       var $iframe = $("iframe").attr("src","http://www.google.com");
  17.       setInterval(function() {
  18.         (currentSite == 0) ? currentSite = sites.length - 1 : currentSite = currentSite -1;
  19.         $iframe.attr("src",sites[currentSite]);
  20.       }, 7000);
  21.     });
  22.   </script>
  23.   <style type="text/css" media="screen">
  24.     iframe {
  25.       height: 100%;
  26.       width: 100%;
  27.       border: none;
  28.     }
  29.   </style>
  30. </head>
  31. <body>
  32.   <iframe></iframe>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement