View Full Version : hide popupmenu
What code is necessary to hide a popup menu? I made some popupmenus in dreamweaver, and they had the option to hide on MouseOut, but they don't do it. Any ideas?
putts
03-19-2005, 10:49 PM
Let's see the code on those bad boys and maybe we can see what the deal is?
Because it works for showing up, I won't include that code:
onMouseOut="MM_startTimeout();"
so we look at MM_startTimeout:
function MM_startTimeout() {
if( window.ActiveMenu ) {
mmStart = new Date();
mmDHFlag = true;
mmHideMenuTimer = setTimeout("mmDoHide()", window.ActiveMenu.Menu.hideTimeout);
}
}
so, we see that this function calls another function, mmDoHide:
function mmDoHide() {
if (!mmDHFlag || !window.ActiveMenu) return;
var elapsed = new Date() - mmStart;
var timeout = window.ActiveMenu.Menu.hideTimeout;
if (elapsed < timeout) {
mmHideMenuTimer = setTimeout("mmDoHide()", timeout+100-elapsed);
return;
}
mmDHFlag = false;
hideActiveMenus();
window.ActiveMenuItem = 0;
}
This is just an interesting situation is all. Dreamweaver normally does what it's told, and in this case it doesn't. Also, I haven't provided all the code. Since this function goes on for quite a bit, because it calls function after stinking function. If you think that I need to provide more code to find the solution, I'll put it up. Otherwise, I don't think it'll look good for a page full of source.
putts
03-20-2005, 09:02 PM
Can I see the code for the actual <a> link?
<a href="#" onMouseOver="MM_swapImage('busvideos','','overbusinessbutton.jpg',1);MM_showMenu(window.mm_menu_0311174743_0,232, 0,null,'busvideos')" onMouseOut="MM_swapImgRestore();MM_startTimeout();"><img name="busvideos" src="businessbutton.gif" width="232" height="35" border="0" alt="Business Videos"></a>
putts
03-21-2005, 11:25 PM
What if you take the SetTimeout off the onMouseOut?
That wasn't it. The delay on my menus was too long. So, I changed from 3 seconds to 1/10th of a second. I guess I can chalk it up to user error :D
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.