Teil von SELFHTML Forum Teil von SELFHTML Forumsarchiv Teil von 2003 Teil von Mai

SELFHTML Forumsarchiv
Bildwechsel

Informationsseite
  1. Seite (JAVASCRIPT) Bildwechsel von Andreas, 30. 05. 2003, 19:36
    • Seite (JAVASCRIPT) Bildwechsel von David Tibbe, 30. 05. 2003, 19:48
nach unten

Bildwechsel

Die folgende Nachricht zum Thema stammt von: Andreas, 30. 05. 2003, 19:36

Hallo,
ich habe bis jetzt diese funktion verwendet um die Bilder auszutauschen. Nun habe ich aber alles überarbeitet und benutze statt 12 jetzt 34 Bilder. Entweder verlängere ich jetzt meine funktion oder ihr könnt mir helfen.
Gibt es einnen Befehl der z.B. Bild 0-33 zurüchsetzt?

<script language="JavaScript">
<!--
function func(x,y)
{document.images[0].src="rund1.gif";
document.images[1].src="rund1.gif";
document.images[2].src="rund1.gif";
document.images[3].src="rund1.gif";
document.images[4].src="rund1.gif";
document.images[5].src="rund1.gif";
document.images[6].src="rund1.gif";
document.images[7].src="rund1.gif";
document.images[8].src="rund1.gif";
document.images[9].src="rund1.gif";
document.images[10].src="rund1.gif";
document.images[11].src="rund1.gif";
document.images[12].src="rund1.gif";
 document.images[y].src=x }
//-->
</script>


MfG. Andreas

nach obennach unten

Bildwechsel

Die folgende Nachricht zum Thema stammt von: David Tibbe, 30. 05. 2003, 19:48

Hallo

Schlag in SelfHTML einmal Schleifenkonstruktionen nach. die for-Schleife kannst du einfach über alle Bilder jagen und die Zählervariabel als Index des Bildes verwenden. Das sind nacher dann 2,3 Zeilen Code.

Grüße

David

--
\"Nobody will ever need more than 640k RAM!\"
1981 Bill Gates

nach oben
Teil von SELFHTML Forum Teil von SELFHTML Forumsarchiv Teil von 2003 Teil von Mai

© 1998-2006 Seite Impressum, Software: Classic Forum