English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to write a script that delays the display of a menu. It is a tab type menu, so when you mouse over a tab i want the menu to display after a certain delay, but if they move the mouse off the tab before the time is over, it shouldn't display.

i have the method that displays the menu but i'm not sure how to do the delay

2006-12-19 18:09:28 · 2 answers · asked by Brady 3 in Computers & Internet Programming & Design

2 answers

when you mouseover, you start up a delay with setTimeout to do it in a second or so, and then in the mouse out , you do the current hide stuff, but also clearTimeout the timeout!

2006-12-19 18:36:44 · answer #1 · answered by jake cigar™ is retired 7 · 0 0

There are couple of built in functions in Javascript which helps you to get this thing working. We need to primarily understand the logic.
setTimeout() and clearTimeout() works hand in hand to get the output.
Once the user has hovered over the tab you need to set the timer: say 3 seconds. if the person moves out before the three seconds then reset the timer using the cleartime out option,
but otherwise show the menu.

I hope this is clear..

2006-12-19 19:29:47 · answer #2 · answered by pkp 2 · 0 0

fedest.com, questions and answers