<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problemi con timeout in javascript]]></title><description><![CDATA[<p dir="auto">Ho scritto questa breve funzione per gestire un onmouseover<br />
vorrei che al mouseout l'immagine iniziale venga ripristinata dopo qualche secondo, ho provato inserendo un setTimeout con un richiamo ad una funzione esterna ma non funziona. Sapete dirmi perchè?</p>
<pre><code class="language-php">function domRollover() {
    
    var imgarr=document.getElementsByTagName('a');
    var imgPreload=new Array();

    for (i=0;i&lt;imgarr.length;i++){
        if(imgarr[i].className=='quad_link'){
            
            imgPreload[i]=new Image();
            imgPreload[i].src = 'img/icons/'+imgarr[i].id;
            
            imgarr[i].onmouseover = function(){
                document.getElementById(this.name).src='img/icons/'+this.id;
                //alert(this.id);
            }
            imgarr[i].onmouseout = function(){
               setTimeout('rollOut()',2000,this.name);
            }
            
        } // chiude if 
    } // chiude for
} //chiude function
domRollover();

function rollOut(img_name) {
    document.getElementById(img_name).src='img/icons/label_'+img_name+'.gif';
}
</code></pre>
]]></description><link>https://dev.connect.gt/topic/81676/problemi-con-timeout-in-javascript</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 05:04:31 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/81676.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Sep 2008 19:45:09 GMT</pubDate><ttl>60</ttl></channel></rss>