By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

need help with hide function

P: n/a
Hey, Im working on a javascript based menu system :
http://larsandre.mine.nu/menu2.htm

When the user first selected a menu-item the sub-menu appears nicly but if
the user then moves the cursors away from the menu area the sub-menu still
is shown. I need a function that hides the sub-menu. But Im not sure how do
to this. Would appreciate some input on this matter.


Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"John Doe" <jo*****@email.com> wrote in message news:<3f********@news.broadpark.no>...
Hey, Im working on a javascript based menu system :
http://larsandre.mine.nu/menu2.htm

When the user first selected a menu-item the sub-menu appears nicly but if
the user then moves the cursors away from the menu area the sub-menu still
is shown. I need a function that hides the sub-menu. But Im not sure how do
to this. Would appreciate some input on this matter.

Try putting something like this in the onload event of the body tag:

setInterval('checkmenu()',4000)

in checkmenu check to see if any submenus are visible. If they are then hide them.

Hope this helps.
Jul 20 '05 #2

P: n/a
D Elkins wrote:
"John Doe" <jo*****@email.com> wrote [...]
When the user first selected a menu-item the sub-menu appears nicly but if
the user then moves the cursors away from the menu area the sub-menu still
is shown. I need a function that hides the sub-menu. But Im not sure how do
to this. Would appreciate some input on this matter.
Try putting something like this in the onload event of the body tag:


It's the `body' _element_.
setInterval('checkmenu()',4000)

in checkmenu check to see if any submenus are visible. If they are then hide them.


The better way is to put code into the `onmouseout' event handler of the
menu area that hides all submenus. Not only that the interval is too long
here (4 seconds?), it also steals the user computing time better to be used
for other purposes.
PointedEars

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.