[Javascript] A loop for this script?

Paul Novitski paul at novitskisoftware.com
Sun Jul 3 02:06:24 CDT 2005


Roland,

With respect, I'd like to take a step back from your javascript looping 
problem to say that I don't really enjoy the effect you're trying to 
achieve here: to delay the disappearance of a submenu on 
mouseout.  Personally I like things to happen immediately in response to my 
actions on screen, I find delayed responses awkward at best and irritating 
or confusing at worst, and I can't think of any benefit that would obtain 
from letting a menu (or other page element) persist for half a second or so 
after I told it to go away.  The web is full of dynamic effects that show 
off the cleverness of us programmers but don't actually benefit the user, 
so I've got my critic's hat on here.  Sorry if I'm missing the point -- I'm 
not, after all, seeing your whole GUI.  Can you describe the effect you're 
reaching for?

Thanks,
Paul



At 10:32 AM 7/2/2005, Roland Dong wrote:

> > -----Original Message-----
> > From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]
> > On Behalf Of Andrew Clover
> > A quick fix would be to precalculate the id and put it in the string:
> >
> >    var id= ids[i];
> >    var f= 'document.getElementById("'+id+'").style.visibility= "hidden"';
> >    var timer= window.setTimeout(f, 500)
> >
>
>
>Andrew,
>
>Thanks for your reply. Actually, Mckinney provided the similar solution a
>few days ago.  The real problem is that I can not pass the value of id to
>getElementById() in the following code:
>
>========================================================================
>document.getElementById("'+id+'").onmouseover=function(){
>         clearTimeout(TIMER);
>document.getElementById("'+id+'").style.visibility="visible";
>}
>
>document.getElementById("'+id+'").onmouseout=function(){
>TIMER=setTimeout('document.getElementById("'+id+'").style.visibility="
>hidden"', 500);
>}
>
>============================================================================
>It complains that  "document.getElementById("'+id+'") has no properties"
>
>This is where I got stuck.  This is the link to the complete code:
>http://www.wiu.edu/users/murbhd/test.html
>
>
>Thanks
>
>
>
>
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list