Diashow Manuell
Diese Diashow läuft nicht automatisch, zum Bildwechsel muss einer der beiden Richtungspfeile angeklickt werden. Diese Show läuft auch mit gemischten Bildern dank des Arrays.
Vorwärts und Rückwärts
new Array()
<script type="text/javascript">
// Variablen
myPix = new Array("images/1.gif","images/2.gif","images/3.gif","images/gelb_4.gif");
thisPic = 0;
imgCt = myPix.length - 1;
// Funktion
function chgSlide(direction) {
if (document.images) {
thisPic = thisPic + direction;
if (thisPic > imgCt) {
thisPic = 0;
}
if (thisPic < 0) {
thisPic = imgCt;
}
document.myPicture.src=myPix[thisPic];
}
}
</script>
HTML:
<a href="javascript:chgSlide(-1)"><<</a> <a href="javascript:chgSlide(1)">>></a>