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:59

Auto open submenu

Poster: PaulS
Dated: Thursday October 30 2003 - 12:29:22 GMT


Is it possible to tell a submenu to auto open, so it would appear that when you are clicking between menus that it has a memory?


I rollover menu item 1 and the submenu appears i click on the link, that page has the DHTML menu it it but the js auto opens the submenu.

I have tried using keepalive but this is no good.


Poster: Hergio
Dated: Thursday October 30 2003 - 21:30:09 GMT

We really should consider a nice little section for code snippets for things such as this...definetly gotta get around to that.. :lol: .

See this ...

Poster: kevin3442
Dated: Friday October 31 2003 - 1:05:01 GMT

Hi Paul, Dave,

Dave (Hergio)... I assume you mean to call mm_showMenu() in the body's onload event for the new page. It had also occurred to me to suggest the mm_showMenu() function, or even the built-in popup(). But then it occurred to me that those wouldn't work if the submenu is defined the way most are... without a location specified. It's been my experience that popup() with just a menuName won't work unless the system can derive a location: either the menu's location was specified in the menu definition (not typical for submenus), it was previously opened on the same page, or its position has been set programtically.

So, once the submenu opens on the initial page, it has a location. But when a new page loads (from clicking a link on the submenu), the menus are built anew and that will reset the submenu back to its locationless state. So the popup() function on the second page won't be able to re-show the menu unless it already has a position. Of course, you could write a function to set the submenu's location before calling popup()... maybe something like a mm_popupAt(menuName, top, left) function, where you pass coordinates. But to make it flexible, and have it accurately reflect the submenu's location on the previous page, the loaction from the original page would have to be passed to the next page, parsed, then fed to the function that re-opens the menu in the same location. At least that's my take... maybe I'm full of crap, but that's my impression of how the stuff works after playing around with different ways to open menus.

I think Paul's goal is do-able, but a little hairy if you're not familiar with js. I was thinking of giving it a try -- I wanted to mess with getting and setting positions anyway. But I'm a little strapped for time tonight and tomorrow. I could maybe give it a shot next week. Anyone else wnat to jump in?