[Javascript] A loop for this script?

Roland Dong rdong at advance.net
Sun Jul 3 07:01:22 CDT 2005


Paul,

Thanks for your reply.  I concur with your comment about the time delayed
response. However, that is part of the requirement I have to deal with. 

This is the use case I am trying to achieve :( use category title "tutorial"
for example)

1. User moves the mouse over "tutorial" on the top menu bar, the submenu for
"tutorial" pops up.

2. User moves mouse away from "tutorial", the submenu disappear in 1 second.

3. User moves mouse down from "tutorial" to the popped submenu area, the
submenu will stay visible.

4. User moves mouse away from the submenu, the submenu disappears in 1
second.  

I did try the suggestion you gave in your previous message but couldn't make
it work. Got stuck here for a while. 

I greatly appreciate your help.

Again, this is the url:

http://www.wiu.edu/users/murbhd/test.html

 



> -----Original Message-----
> From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]
> On Behalf Of Paul Novitski
> Sent: Sunday, July 03, 2005 3:06 AM
> To: JavaScript List
> Subject: RE: [Javascript] A loop for this script?
> 
> 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
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list