Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:29

popup() function issue


Poster: jhilden
Dated: Tuesday October 11 2005 - 17:08:58 BST

Here's my menu:
Code:
   with(milonic=new menuname("logout_menu")){
      alwaysvisible=0;
      followscroll=1;
      border=5;
      left=0;
      margin=0;
      orientation="horizontal";
      style=ScrollingSampStyle;
      menuwidth="100%";
      menuheight="100%";
      top=0;
      overfilter="Alpha(opacity=75);";
      menualign="right";
      aI("text=........");


I call popup("logout_menu") to show this menu, that works great. My problem is that while the menu is shown if you move the mouse outside of the IE display window (to the address bar or start button for example) the menu hides itself.

what's up with that??

Thanks in advance!

Cheers.


Poster: jhilden
Dated: Tuesday October 11 2005 - 19:20:31 BST

Ok, I did some more digging and I believe that I have found an error with the menu system.

The error is this: if you show a window using the popup() function in IE, and then click anywhere other than the viewing window (for example you minimize the window and bring it back again), when you then hide the popup menu you cannot edit any form elements that were under the menu.

This is best illistrated with the code below. You should be able to strait copy and paste it into your own system, the only change that needs to be made is the path to the 2 included js scripts.

The function that actually hides and shows the menu is show_logout_menu()

Code:
<html>
<body onLoad="setTimeout('show_logout_menu(1)',5000)">
<script type="text/javascript" src="/js/menu/milonic_src.js"></script>
<script type="text/javascript" src="/js/menu/mmenudom.js"></script>
<script type="text/javascript">
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;
with(ScrollingSampStyle=new mm_style()){
   bordercolor="transparent";
   borderstyle="transparent";
   offbgcolor="#E2DBE9";
   onbgcolor="#E2DBE9";
   oncolor="#8363A7";
   offcolor="#8363A7";
   borderwidth=0;
   fontfamily="Tahoma,Helvetica,Verdana";
   fontsize="70%";
   fontstyle="normal";
   fontweight="normal";
   padding=0;
}
var windowWidth = document.body.offsetWidth - 22;//-22 is to take into acct the scrollbar
var windowHeight = document.body.offsetHeight - 22;   

with(milonic=new menuname("logout_menu")){
   alwaysvisible=0;
   followscroll=1;
   border=5;
   left=0;
   margin=0;
   orientation="horizontal";
   style=ScrollingSampStyle;
   menuwidth="100%";
   menuheight="100%";
   keepalive=0;
   top=0;
   overfilter="Alpha(opacity=75);";
   menualign="right";
   aI("text=`<table width='" + windowWidth + "' height='" + windowHeight + "' border=0><tr valign='center' align='center'><td><h2><b><font color='black'>Your session has been inactive for 5 minutes.<br>  You will be logged out in <span id='timeout_span'>60</span> seconds.<br><br><input type='button' style='border-color: #DDDDDD; font-weight:bold; font-size=15; background-image: url(/images/function-button_bkgd.gif); border-style: inset' ID='logout_button1' value='click here to cancel logout' onClick='show_logout_menu(0);'></td></tr></table>`;type=form;align=bottom");
}

function show_logout_menu(onOff) {
   var menuNum = getMenuByName("logout_menu");
   _m[menuNum][10] = onOff;//turn keepalive onOff 
   if (onOff == 1) {
      popup("logout_menu");//show logout menu
   }
   else {
      popdown();
      setTimeout('show_logout_menu(1)',5000);
   }
}

drawMenus();
   
   
</script>
<ol>
   <li>Wait 5 seconds for the menu to appear</li>
   <li>Hit the cancel button -> you will still be able to edit the textbox below</li>
   <li>Wait another 5 seconds for the menu to re-appear</li>
   <li>Minimize the IE window, then maximize</li>
   <li>Click the cancel button -> <h2><b>YOU CAN NO LONGER EDIT THE TEXTFIELD</li>
</ol>
<form>
   
<input type="textbox" size=15 value="edit me">
</form>
</body>
</html>


This is very frustrating and any help would be greatly appreciated!!


Poster: jhilden
Dated: Tuesday October 11 2005 - 20:33:16 BST

Ok, I found a hack around the problem.

Code:
function show_logout_menu(onOff) {
   var menuNum = getMenuByName("logout_menu");
   _m[menuNum][10] = onOff;//turn keepalive onOff 
   if (onOff == 1) {
      popup("logout_menu");//show logout menu
   }
   else {
      //show the menu again and then hide it right away
      //don't agrue, just trust me!
      popup("logout_menu");//show menu
      setTimeout('menuDisplay('+menuNum+',0)', 2);//hide menu after 2 milliseconds
   }
}


what changed is that when I want to hide the menu I actually show the menu again, then 2ms later I hide it. What that does is ensures that the end user will not have time to move his/her mouse away from the menu, thus eliminating my above problem. It would be really nice if someone had a real solution and not just a hack though.


Poster: Andy
Dated: Thursday November 3 2005 - 15:33:25 GMT

Hi,

I just tried the original code with the Pre Release version of the menu and it seems to be OK, at least on my machine anyway.

Not sure what happend to fix it but seems to be fixed now.

Pre release is available at http://www.milonic.com/menuvinfo.php