ich möchte hier eine OnMouseOver funktion so schreiben das sie jedesmal ein zufalls bild lädt wenn ich darüber fahre:
<html>
<head>
<script type="text/javascript">
arr = new Array();
arr[0] = 'bild01.bmp';
arr[1] = 'bild02.bmp';
arr[2] = 'bild03.bmp';
//onmouseover="test();"
function test()
{
document.write('<img onmouseover="test();" src="'+arr[Math.round(Math.random()*(arr.length-1))]+'">');
};
</script>
</head>
<body>
<table>
<tr>
<td><script>document.write('<img onmouseover="test();" src="'+arr[Math.round(Math.random()*(arr.length-1))]+'">');</script></td>
</tr>
</table>
</body>
</html>
Irgendwie klappt es nur 1 mal...Hmmm....

Hilfe
Neues Thema
Antworten


Nach oben

