drop down menu not closing onclick
drop down menu not closing onclick
I've got calls to ajax populating div areas without page reload, and the drop down menus won't clear when clicked. I presume the design assumes a page re-load, so this would not be a problem, but my site does not ever do a page re-load, only content refresh. Any idea what's wrong? Am I missing something?
- Karlis
- Site Admin
- Posts: 3605
- Joined: Mon Jul 15, 2002 5:24 pm
- Location: Riga, Latvia, Europe
- Contact:
Re: drop down menu not closing onclick
Menus have nothing to do with refreshing he page. Please note, however, that if you are processing page content you must be careful not to touch anything connected with menu code. You should not alter the HTML or CSS code of the menus in any way.
If you would like us to take a look, just drop in a link to your page or a test page that demonstrates the problem and we will look at it.
If you would like us to take a look, just drop in a link to your page or a test page that demonstrates the problem and we will look at it.
Re: drop down menu not closing onclick
Thanks for the reply. Here is a link to the page. Select "Artist Tools" then "Tour Planner".
http://www.toursavant.com/rg
http://www.toursavant.com/rg
- Karlis
- Site Admin
- Posts: 3605
- Joined: Mon Jul 15, 2002 5:24 pm
- Location: Riga, Latvia, Europe
- Contact:
Re: drop down menu not closing onclick
Does your javascript function return ture? I'm not an expert of JavaScript, but it seems that your should return a true value for this to go through.
Re: drop down menu not closing onclick
I tried that just now. With target="_self", it brings up a blank page with "true" as the only content, with target="fileuploadframe", which is a hidden iframe, it executes the desired function, who's content ends up in "main" div, but the submenu still does not close.
I've looked around at other sites using this menu system, and all the ones I found actually navigate to a new page when a submenu item is clicked, so of course, the menu is "closed", since the page has changed. In fact, the submenu stays visible until the current page goes away, pending loading of the new page. In my case, I'm not navigating off the page at all, just changing the innerHTML property of a div on the current page. Hope this makes sense and you can help me.
I've looked around at other sites using this menu system, and all the ones I found actually navigate to a new page when a submenu item is clicked, so of course, the menu is "closed", since the page has changed. In fact, the submenu stays visible until the current page goes away, pending loading of the new page. In my case, I'm not navigating off the page at all, just changing the innerHTML property of a div on the current page. Hope this makes sense and you can help me.
- Karlis
- Site Admin
- Posts: 3605
- Joined: Mon Jul 15, 2002 5:24 pm
- Location: Riga, Latvia, Europe
- Contact:
Re: drop down menu not closing onclick
The developer said that you must call this JavaScript function to close the menu:
Try it.
Code: Select all
ebmTickerOn(cbnOpenTopMenu);
Re: drop down menu not closing onclick
That fixed it, thanks much.