Hi,
For days I haven't been able to find the answer to the following problem.
I have a testcase using css menu/AJAX with two levels similar to the one in this example http://www.alistapart.com/articles/horizdropdowns/
I have everything working except for an annoying behavior. When I open a submenu (2nd level) and click on it, by using AJAX the innerHTML field change to whatever text I want but the submenu remains open.
How can I close or refresh the menu/submenu when I click on it?
CSS menus question
Moderator: General Moderators
Re: CSS menus question
Better post your code, or put it online somewhere....
Re: CSS menus question
Probably to an element you have attached an event listener, so you can use 'this' in that function and
Code: Select all
this.style.display = 'none';Re: CSS menus question
Here is quick example not using AJAX http://www.geocities.com/trifid_sagitarius/index.htm
Click on any 2nd level submenu, the text changes and the menu remains open.
Click on any 2nd level submenu, the text changes and the menu remains open.
Re: CSS menus question
Me thinks your <ul class="submenu"> needs an id as well, so you can close it....
Re: CSS menus question
Yep, that did it.kaszu wrote:Probably to an element you have attached an event listener, so you can use 'this' in that function andCode: Select all
this.style.display = 'none';
Thanks
[Edit] The only thing left is to reverse the procedure once the submenu disappears.