Bug with keep alive form objects

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Bug with keep alive form objects

Post by e-spike »

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: Select all

function closeAllKeepAliveMenus(){
    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
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

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
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

bump still need help urgently
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

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
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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: Select all

<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>
(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: Select all

<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>
(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
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

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
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

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
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

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
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

bump...any progress?
e-spike
Advanced
Advanced
Posts: 28
Joined: Tue Aug 23, 2005 12:31 pm

Post by e-spike »

turns out the fix is to change the hideallkeepalivemenus() function to this:

Code: Select all

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) 
    } 
  } 
} 
Thanks andy :)

Rich
Post Reply