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:33
Bug with keep alive form objects
Poster: e-spike
Dated: Wednesday August 31 2005 - 19:01:07 BST
We have a form within our menu, and it contains a drop down box. We had to make i keepalive to prevent the form 'submenu' from hiding when a user selected something from the dropdown menu, as advised on this very forum.
Now we have noticed a very strange behaviour whereby if the user shows search submenu, then closes it using the following function (also defined on these forums)
Code:
function closeAllKeepAliveMenus(){
for(_a=0;_a<_m.length;_a++){
if(_m[_a][10])menuDisplay(_a,0)
}
}
for(_a=0;_a<_m.length;_a++){
if(_m[_a][10])menuDisplay(_a,0)
}
}
The menu hides, but no mouse events are recorded below, so css hover on the items below where the menu was, and click events etc, aren't registered. To recreate this go to:
http://newcom.eunify.net login as sserra leandra and you should see a table of elements. Click search on the milonic menu, and change the drop down category value from all to Misc or the other way around. Then without submitting, click close - you'll see that even the table row highlighting code doesn't work for the square area underneath where the search box had previously displayed.
This should all be done in IE
Poster: e-spike
Dated: Monday September 5 2005 - 13:04:54 BST
bump - still need help! Why are all the mouse events ignored under a keepalive menu once it is killed using the code above>?
Please help - i've been waiting a while now and i really need this resolved
thanks
rich
Poster: kevin3442
Dated: Thursday September 8 2005 - 1:41:55 BST
Hi Rich,
I just tried http://newcom.eunify.net/ but that gets me an "Intranet site does not exist" message. So I figured I'd try the url you posted in the original thread where I suggested trying the keepalive property. That url is http://newcom.serran.net/ . It got me in at first, and I was having a look, but then I accidentally closed the browser. Now the same url gives me a page that says:
This is the Home Page. You have been directed here since some app directed you here after calling GetHomePageName.
Even tried your Login.asp page... no dice. I figure you must be working on some things right this moment and a redirector sent me away? Can I get another look?
Kevin
Poster: e-spike
Dated: Thursday September 8 2005 - 9:51:13 BST
I'm sorry the login page is a little buggy at the moment. Its currently set to check the login and forward to a non-existant homepage (as we have't yet written that). If it happens again close all windows to end the session, and log back in
the address is indeed http://newcom.serran.net
You should what i'm talking about within the announcement application /announcement.asp
Thanks again
Rich
Poster: kevin3442
Dated: Thursday September 8 2005 - 10:16:40 BST
Hi Rich,
Couldn't resist a quick look. Some quick suggestions that may or may not work:
You currently have the following code to load the main menu scripts and some of your own menu code:
Code:
<script type="text/javascript" src="milonic_src.js"></script>
<script language="JavaScript" type="text/javascript" src="menu_data2.js"></script>
<noscript>
Your Browser doesn't support Javascript. Please see our minimum system requirements.
</noscript>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script language="JavaScript" type="text/javascript" src="menu_data2.js"></script>
<noscript>
Your Browser doesn't support Javascript. Please see our minimum system requirements.
</noscript>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
</script>
(1) This is minor, and probably not really a concern, but standard practice would be to load menu_data2.js at the end of that block, rather than after milonic_src.js. Like so:
Code:
<script type="text/javascript" src="milonic_src.js"></script>
<noscript>
Your Browser doesn't support Javascript. Please see our minimum system requirements.
</noscript>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script language="JavaScript" type="text/javascript" src="menu_data2.js"></script>
<noscript>
Your Browser doesn't support Javascript. Please see our minimum system requirements.
</noscript>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script language="JavaScript" type="text/javascript" src="menu_data2.js"></script>
(2) You have all of the menu code inside the table. Not good. The only code that should be inside of the table is the code for the main menu. All other styles and submenu definitions should be defined outside of the table (say... in your menu_data2.js file). Good place to load all of that is right after the <body> tag. Refer to this and this for discussions of how to embed a menu in a table.
See if that helps so far.
(3) Even after that, you'll still have the menu inside of nested DIVs. The menu sometimes does odd things when inside of DIVs. Is there any way you can position it without using divs? There are several positioning options. If nothing else, can you use the table to position it without embedding the table in a div?
I'll check back later. Good luck.
Kevin
Poster: e-spike
Dated: Thursday September 8 2005 - 18:27:38 BST
I've tried everything you've suggested. I've even binned some of the divs, which are really fundamental to our design, and it still has the same behaviour. It is only with keepalive menus. Its as if your hideall function doesn't tell the menu to start recording mouse positions again after the keepalive property is taken away
Poster: e-spike
Dated: Thursday September 8 2005 - 18:30:05 BST
i'd like to add at this point that if i remove the keepalive attribute - the menu works fine - just not how we need it to behave with respect to hiding
Poster: e-spike
Dated: Thursday September 8 2005 - 20:09:08 BST
would it be possible to have a different hideallkeepalive function which does something like calls itemoff or something? I'm not totally sure how this works but it could fix it. Or how about if keepalive was turned on when the menu item is opened, and turned off immediately before it is closed? Would that fix it and how would i code that
Do you know what's going on>?
rich
Poster: e-spike
Dated: Tuesday September 13 2005 - 15:52:17 BST
turns out the fix is to change the hideallkeepalivemenus() function to this:
Code:
function closeAllKeepAliveMenus(){
for(_a=0;_a<_m.length;_a++){
if(_m[_a][10]){
menuDisplay(_a,0);
}
_gm=gmobj("iFM"+_a)
if(_gm){
_gm.style.visibility="hidden"
spos(_gm,-9999)
}
}
}
for(_a=0;_a<_m.length;_a++){
if(_m[_a][10]){
menuDisplay(_a,0);
}
_gm=gmobj("iFM"+_a)
if(_gm){
_gm.style.visibility="hidden"
spos(_gm,-9999)
}
}
}
Thanks andy
Rich