home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / FREI / JSCRIPT.ARJ / JSCRIPT.ZIP / MSROLL.BAK < prev    next >
Encoding:
Text File  |  1997-08-29  |  1.3 KB  |  64 lines

  1. <html>
  2. <head>
  3. <title>Bildwechsel</title>
  4. <script language="Javascript">
  5. <!-- auskommentieren
  6. if (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion.substring(0,1)) >=3))
  7.         || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion.substring(0,1)) >=4))) {
  8.         var version=true
  9.     }
  10.  
  11.  
  12. function change(name, bild)
  13. {
  14.     if (version)
  15.     {
  16.         this.document[name].src=bild
  17.     }    
  18. }
  19.  
  20. function roll()
  21. {
  22.     var zaehler=0
  23.     var i=0
  24.     while(zaehler < 4)
  25.     {    
  26.         zaehler=(zaehler+1)%3
  27.         alert(zaehler)
  28.         if (zaehler==0)
  29.         {    change("bild1", "gods.jpg")
  30.             change("bild2", "moab1.jpg")
  31.             change("bild3", "hurrah.jpg")
  32.         }
  33.         if (zaehler==1)
  34.         {    change("bild2", "gods.jpg")
  35.             change("bild3", "moab1.jpg")
  36.             change("bild1", "hurrah.jpg")
  37.         }
  38.         if (zaehler==2)
  39.         {    change("bild3", "gods.jpg")
  40.             change("bild1", "moab1.jpg")
  41.             change("bild2", "hurrah.jpg")
  42.         }
  43.     }
  44. }
  45. // -->
  46. </script>
  47.  
  48. </head>
  49. <body bgcolor=maroon text=yellow link=yellow>
  50. <center>
  51. <h1>Animation</h1>
  52. <br>
  53. <img src="hurrah.jpg" name=bild1>
  54. <img src="gods.jpg" name=bild2>
  55. <img src="moab1.jpg" name=bild3>
  56. <form name="klick"> 
  57.     <input type="button" value="Animation starten" onClick="roll()">
  58. </form>
  59. </center>
  60. </body>
  61. </html>
  62.  
  63. </body>
  64. </html>