Andreas Schneider: button

Beitrag lesen

Hallo Marcus,

hi hier ist ein script für einen button aber ich will für die buttons unterschiedliche links haben hier heissen sie ja nur link1,link2,link3,usw. ich z.b. wenn ich einen button mit http://forum.de.selfhtml.org z.b. wie soll ich das machen??

z.B. so:

<html>
<head>
<script type="text/javascript">
<!--
var bild = new Array()
var buttons = 7;

var links = new Array("http://forum.de.selfhtml.org/", "http://selfaktuell.teamone.de/", ...5 weitere Links...);

for( i = 1; i <= buttons * 3; i++ ){
bild[i] = new Image();
bild[i].src = i + ".gif";
}
//-->
</script>
</head>
<body>
<script type="text/javascript">
<!--
for( i = 1; i <= buttons; i++ ){
a = 3 * i - 2;
b = a + 1;
c = a + 2;

document.write( "<a href="" + links[i] + "" " +

"onmousedown="document.bild" + i + ".src=' " + c + ".gif';" " +
"onmouseup="document.bild" + i + ".src=' " + a + ".gif';" " +
"onmouseover="document.bild" + i + ".src=' " + b + ".gif';" " +
"onmouseout="document.bild" + i + ".src=' " + a + ".gif';" " +
"onfocus='this.blur();'><img name='bild" + i + "' src=' " + a + ".gif' border='0'></a><br><br>" );
}
//-->
</script>
</body>
</html>

Grüße
Andreas