Bildertausch per Diaschau-Script
Das JavaScript sieht wie folgt aus
Position in der html-Datei:
head
-Bereich
<script type="text/javascript"> <!-- testurl = new Array(3); testurl[1]="bild_1.jpg" testurl[2]="bild_2.jpg" testurl[3]="bild_3.jpg" var picturestart = 0 var pictures = 1 var totalpictures = testurl.lenght-1 var play = 1 var pause = 0 var wechselzeit = 4000 // millisekunden //--> </script>
Position in der html-Datei:
body
-Bereich
<script type="text/javascript"> <!-- function slideshowupdate(imgName,controls) { if (play == 1) { slidesslideshow = new Image(37,149); slidesslideshow.src = testurl[pictures]; slideshow = eval(imgName + "slideshow.src"); document[imgName].src = slideshow; pictures=pictures + 1 if (pictures > totalpictures) pictures=1 if (controls != 1) timedelay(); return; } timedelay(); return; } function timedelay() { timerID = setTimeout("slideshowupdate('slides',0)",wechselzeit); } function cplay() { play=1 } function cbegin() { if (play == 0) { play=1 pictures=1 slideshowupdate('slides') play=0 return; } pictures=1 slideshowupdate('slides',1) } function cprev() { if (play == 0) { play=1 if (pictures < 3) pictures=pictures+totalpictures pictures=pictures-2 slideshowupdate('slides',1) play=0 return; } if (pictures < 3) pictures=pictures+totalpictures pictures=pictures-2 slideshowupdate('slides',1) } function cnext() { if (play == 0) { play=1 slideshowupdate('slides',1) play=0 return; } slideshowupdate('slides',1) } function cend() { if (play == 0) { play=1 pictures=totalpictures slideshowupdate('slides',1) play=0 return; } pictures=totalpictures slideshowupdate('slides',1) } function cstop() { play=0 } function cpause() { if (pause == 0) { pause=1 pauseon() return; } if (pause == 1) { pause=0 pauseon() return; } } function pauseon() { if (pause == 1) { play = 0 return; } play = 1 } //--> </script>
Position des Präsentationsgrafik-Elementes in der html-Datei:
body
-Bereich
<img height="300" src="bild_1.jpg" width="400" border="1" name="slides" color="#CCCCCC" alt="">
Position Steuerelemente für die Präsentation in der html-Datei:
body
-Bereich
<script type="text/javascript"> <!-- timedelay(); document.write('<a href="javascript: cprev()"><img src="ipixSlideshowPrev.gif" border="0" width="55" height="50"><\/a><a href="javascript: cstop()"><img src="ipixSlideshowStop.gif" border="0" width="55" height="50"><\/a><a href="javascript: cplay()"><img src="ipixSlideshowPlay.gif" border="0" width="55" height="50"><\/a><a href="javascript: cnext()"><img src="ipixSlideshowNext.gif" border="0" width="55" height="50"><\/a>'); //--> </script>
Quelle:
www.ebay.de
© 2002