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:34
Pre-priming amazon-style menu with sub-menu selection?
Poster: CobaltSoftware
Dated: Sunday May 20 2007 - 21:15:25 BST
Hey guys,
Please note, I am aware of the existence of the URL based opener, but
that's not what I'm looking for. Just in case anyone tries to tell me
to look at it.
I've got a 5.x menu (some of the code follows) I'm working on for a client
who's bought this thing. It works great so far! We're using the Amazon
style, with tab headers and the sub-menus coming down beneath.
What I'm wondering though, is if it's possible to prime/pre-select the a
menu when the page loads, so a given sub menu (i.e. ARTISTS) gets
drawn immediately, without having to have the user click it first. The item
we prime is arbitrary, so we can't pre-code the menudata file to contain
this selection, it has to be a run-time popping up of a sub-menu.
We're planning to use a bit of ASP to call that, in order to have the menu
appear to select the relevant tab for the current section of the site by
inserting some javascript into the onload() of the body tag.
Any advice? I've tried all the commands for popping up /
showing 'ARTISTS' using the methods reference and I must be missing
something, since nothing seemed to work.
Thanks in advice.
Regards,
-Steve Gray
-Cobalt Software
Code:
with(menuStyle=new mm_style())
{
bgimage="";
bgimage="http://media.pulserated.com/_img/standards/menu/
silver_back.gif";
fontfamily="Arial, Helvetica, sans-serif";
fontsize="100%";
fontstyle="normal";
fontweight="bold";
itemheight=26;
itemwidth=80;
offcolor="#000000";
oncolor="#FFFFFF";
openonclick=1;
subimagepadding=2;
clickbgimage="http://media.pulserated.com/_img/standards/menu/
silver_back_on.gif";
}
with(submenuStyle=new mm_style())
{
styleid=1;
align="left";
bgimage="";
fontfamily="Arial, Helvetica, sans-serif";
fontsize="100%";
fontstyle="normal";
fontweight="bold";
itemheight=20;
offbgcolor="";
offcolor="#ffffff";
oncolor="#ffffff";
ondecoration="underline";
openonclick=1;
padding=4;
separatorimage="http://media.pulserated.com/_img/standards/menu/
tab_subback_sep.gif";
separatorsize=3;
}
with(milonic=new menuname("Main Menu"))
{
alwaysvisible=1;
openstyle="tab";
orientation="horizontal";
screenposition="";
style=menuStyle;
aI("align=center;keepalive=1;showmenu=MAIN;text= MAIN ;");
aI("align=center;keepalive=1;showmenu=ARTISTS;text= ARTISTS ;");
aI("align=center;keepalive=1;showmenu=RADIO;text= RADIO ;");
aI("align=center;keepalive=1;showmenu=BUSINESS;text= BUSINESS ;");
}
with(milonic=new menuname("MAIN"))
{
menualign="left";
menuwidth="50%";
orientation="horizontal";
screenposition="";
left="offset=10";
style=submenuStyle;
aI("text=HOME;url=index.aspx;");
aI("text=ABOUT US;url=content.aspx?page=about;");
aI("text=NEWS;url=news.aspx;");
aI("text=COOL STUFF;url=content.aspx?page=coolStuff;");
aI("text=LINKS;url=content.aspx?page=links;");
aI("text=CONTACT;url=content.aspx?page=contact;");
aI("separatorsize=4;");
}
with(milonic=new menuname("ARTISTS"))
{
menualign="left";
menuwidth="50%";
orientation="horizontal";
screenposition="";
left="offset=-70";
style=submenuStyle;
aI("text=SEARCH;url=search.aspx;");
aI("text=SUBMIT;url=content.aspx?page=submission;");
aI("text=ADVICE;url=content.aspx?page=ArtistAdvice;");
aI("text=GIG GUIDE;url=gigs.aspx;");
aI("text=HOT TRAX;url=content.aspx?page=hot_trax;");
aI("text=DOWNLOADS;url=storefront.aspx;");
aI("text=INTERVIEWS;url=content.aspx?page=interviews;");
aI("text=CHART;url=content.aspx?page=chart;");
aI("separatorsize=4;");
}
... yada yada....
Poster: Ruth
Dated: Monday May 21 2007 - 19:08:29 BST
Hi,
I'm sorry, but I must not understand what it is you want since you are saying you don't want the openmenusbyurl module. Are you not trying to have a menu opened when you reach the page?
Ruth
Poster: CobaltSoftware
Dated: Monday May 21 2007 - 21:21:40 BST
I want to be able to, on command, open an arbtirary sub-menu.
For example:
Code:
<script language="Javascript">
openSubMenu('ARTISTS');
</script>
openSubMenu('ARTISTS');
</script>
I've tried the popup command, and a few others, but I must be missing something. Note that I don't want to open by URL, because what an URL maps to on the menu varies, hence the openbyurl js bolt-on is entirely unsuitable for my needs.
Poster: Ruth
Dated: Tuesday May 22 2007 - 6:21:56 BST
Hi,
You are going to have to contact Milonic for help on this. None of the volunteers on the forum has any js knowledge to help you achieve this.
I think the reason that the pop function is not working is that it isn't really designed to be part of the menu_data.js file, rather it's to link to a submenu from say a text link, or maybe an image on the page.
There are two other functions on that methods and functions page that, maybe those would be what you want, but again, I have no idea how to use them. They are called itemOn and itemOff.
I will post to Milonic for this question, but you might also contact them for help on this. If you do figure it out could you post back on how? It might help someone else who wants to do that.
Ruth
Poster: CobaltSoftware
Dated: Tuesday May 22 2007 - 6:27:40 BST
Thank you. I'll contact them at start-of-business today.
Also, why do people have so much trouble relatively positioning the menu? I was able to achieve alignment of the menu inside a div within about ten minutes of work, since the entire layout I'm using is table-less.
Is this a big development as far as the user community here goes? If so, I'd be willing to consider posting some HTML to show people, since it seems odd noone else got this going.
Poster: Ruth
Dated: Tuesday May 22 2007 - 6:48:08 BST
Hi,
I think originally it had to do with having to split out the main menu from the menu_data file and either put it into the table cell or into it's own file and making sure that all the other files were called first right after the body tag. For new users who were just starting with the menu, and just learning how to set up the menu_data file that just added one more thing that sort of overwhelmed them. With the new method of using buildAfterLoad=true; it's much easier since all calls for all files are placed in the cell or div with that method. Since the post of the sticky and the new method there haven't been many posts on table placement except when there's been some css conflict causing the submenus to open wrong in some browsers.
There is a sticky, or did you mean something else? There's a link to a page to show how to do it.
http://support.milonic.com/beginners/ta ... /index.htm
Ruth
Poster: CobaltSoftware
Dated: Tuesday May 22 2007 - 16:04:50 BST
I emailed off using the website box earlier today regarding the menu pre-selecting, but nothings come back. I hope they get back to me soon, but I'm rather suprised that not one person has tried such a thing before. It seems like the kind of thing thats easily possible if you know the magic ten characters of script
As for the table stuff, thanks, but like I said, it's already relatively-positioned inside our CSS based layout *perfectly* without the need to invoke a table. We just need the ability to pre-select an abitrary sub-menu and we're good to go as far as menus
Poster: Ruth
Dated: Tuesday May 22 2007 - 18:47:33 BST
Hi,
You are not required to invoke a table. You can put it in a div using the same set up. It's just a lot of people still use tables, especially those who do not have time to learn a whole new discipline such as css. If it's your line of work, then you spend a lot of time at it, if you're just doing your little website and your 40-60hrs a week are say a mechanic, you don't have time to study the zillions of css rules and regs, so tables are real easy for those.
Ruth