Christian: Diskjunk-Rollover per Zufall steuern

Beitrag lesen

Hallo liebe Leut,

ich speicherte die Namen der Bilder(fake), die ich per Zufall in ein anderes umändern will.
Der Code ist komplett fertig geschrieben, nur kann ich den Zufallswert nicht brauchbar umsetzen.

Wäre cool jemanden zu finden der mir helfen könnte!

Dank schon einmal im Voraus!

ciau Christian

<html>
<head>
<title>Unbenanntes Dokument</title>

<script language="javascript" type="text/javascript">
<!--

name = new Array("fake","sp1","sp2","sp3","sp4");
var a=0;

function zufall()
{
 a=Math.random();
 a*=3;
 a=Math.ceil(a);
}

// -->
</script>
</head>

<body>
<table width="303" height="310" border="0" cellpadding="0" cellspacing="0" background="gold4.jpg">
  <tr>
    <td><table width="303" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="spacer.gif" name="sp1" width="75" height="20" id="sp1"></td>
          <td> </td>
          <td> </td>
          <td><img src="gold.gif" name="gold" width="75" height="20" id="gold"
                               onMouseOver="document.name[a.zufall()].src='gold.gif'"></td>
        </tr>
        <tr>
          <td> </td>
          <td><img src="spacer.gif" name="sp2" width="75" height="20" id="sp2"></td>
          <td> </td>
          <td> </td>
        </tr>
        <tr>
          <td> </td>
          <td> </td>
          <td><img src="spacer.gif" name="sp3" width="75" height="20" id="sp3"></td>
          <td> </td>
        </tr>
        <tr>
          <td> </td>
          <td> </td>
          <td> </td>
          <td><img src="spacer.gif" name="sp4" width="75" height="20" id="sp4"></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>