Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <script type="text/javascript">
  5.    
  6.     var liste = ["Hallo", "wie", "gehts"];
  7.     var currentItem = 0;
  8.  
  9.     function next()
  10.     {
  11.         currentItem++;
  12.         return liste[currentItem%liste.length];
  13.     }
  14.  
  15.     function previous()
  16.     {
  17.         currentItem = (currentItem + liste.length - 1) % liste.length;
  18.         return liste[currentItem];
  19.     }
  20.  
  21.     document.write(next());
  22.     document.write(previous());
  23.  
  24.  
  25. </script>
  26.  
  27. <head>
  28.     <title></title>
  29. </head>
  30. <body>
  31.  
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement