This would not work:
<div id="menu1"style="display:none;" onmouseout="delayhide_menu(this.id); >
The solution:
<div id="menu1" style="display:none;" onmouseout="delayhide_menu(this.id); onmouseover="display_menu(this.id);">
You need to define a onmouseover event to counter the activation of the onmouseout event whenever the mouse moves within the div. In addition, you need to add more lines of code in the display and hide menu functions concerning the timers.
<script type="text/javascript">var popupTimerHandle = null;function display_menu(id) {var menu_element = document.getElementById(id);menu_element.style.display = "block";if (popupTimerHandle != null) {clearTimeout(popupTimerHandle);popupTimerHandle = null;}}function hide_menu(id) {var menu_element = document.getElementById(named);menu_element.style.display = "none";}function delayhide_menu(id) {popupTimerHandle = setTimeout("hide_menu('" + named + "')", 1500);}</script ">
No comments:
Post a Comment