Ratlos: Verzoegerter Rollovereffekt

Hallo zusammen

Ich moechte, dass der bei onMouseOut eintretende Effekt einer Verzoegerung von ca 0.5 sekunden unterliegt. Ich koennte mir vorstellen das man das mit setTimeout erreichen kann, bin jedoch daran gescheitert.

Waere toll wenn jemand eine Loesung haett.

Verkuerzter Quellcode:

<html>

<head>

<title>Science Club</title>

</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<table border="0" width="800" align="center">
    <tr>
        <td>

<div style="position:absolute; top:430px; margin-left:122px; font-size:18pt; font-family:Times New Roman, Arial, serif;"><font color="#0000BB"><a onMouseOver="Centerbild.src=RRoboter.src" onMouseOut="Centerbild.src=RSchriftOut.src">Robotik</a></font></div>

</td>
    </tr>
</table>

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

RSchriftOut = new Image();
RSchriftOut.src = "Menschen.jpg";

RRoboter = new Image ();
RRoboter.src = "Roboter.jpg";

//-->
</script>

</body>

</html>

  1. Hallo Ratlos,
    Ich weiss zwar nicht wieso setTimeout bei dir funktionieren will, aber Versuch es doch mal so (Beispiel):

      
    <html>  
    <body>  
      
    <a id='objektmitid' onMouseOver="EffektIN()" onMouseOut="EffektOUT()">LINKTEXT</a>  
      
    <script type='text/Javascript'>  
    
    
      
    function EffektIN() {  
    document.getElementById('objektmitid').style.color='red';  
    }  
      
    function EffektOUT() {  
    window.setTimeout("document.getElementById('objektmitid').style.color='green'",2000); //Effekt mit 2 Sekunden Verzögerung  
    }  
    
    
      
    </script>  
    </body>  
    </html>  
    
    

    Hallo zusammen

    Ich moechte, dass der bei onMouseOut eintretende Effekt einer Verzoegerung von ca 0.5 sekunden unterliegt. Ich koennte mir vorstellen das man das mit setTimeout erreichen kann, bin jedoch daran gescheitert.

    Waere toll wenn jemand eine Loesung haett.

    Verkuerzter Quellcode:

    <html>

    <head>

    <title>Science Club</title>

    </head>

    <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
    <table border="0" width="800" align="center">
        <tr>
            <td>

    <div style="position:absolute; top:430px; margin-left:122px; font-size:18pt; font-family:Times New Roman, Arial, serif;"><font color="#0000BB"><a onMouseOver="Centerbild.src=RRoboter.src" onMouseOut="Centerbild.src=RSchriftOut.src">Robotik</a></font></div>

    </td>
        </tr>
    </table>

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

    RSchriftOut = new Image();
    RSchriftOut.src = "Menschen.jpg";

    RRoboter = new Image ();
    RRoboter.src = "Roboter.jpg";

    //-->
    </script>

    </body>

    </html>