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

submenus - clicking to open..


Poster: sergio_101
Dated: Thursday September 1 2005 - 21:32:25 BST

i currently have the menu set up at this site:

http://red-red.webhop.net/ACP/index.php

i would like to adjust it so that the when you click "full line items" on the left, the menu pops out, but it does not pop out the submenu unless you click on a product family.

currently, it pops out on mouse over.. i would like it to be on mouse click.

thanks in advance!


Poster: Ruth
Dated: Thursday September 1 2005 - 22:13:53 BST

You are using the onMouseOver and to get it to do it on click I think you have to change that to onClick.

Ruth


Poster: sergio_101
Dated: Friday September 2 2005 - 14:38:16 BST

what i want to do is make it so the submenu is the only one that uses an onClick..

so it would be

button -> onMouseover(showmenu)
menu item -> onClick(showsubmenu)

so, the behavior would change inside..

does that work?


Poster: Ruth
Dated: Friday September 2 2005 - 15:08:35 BST

Add openonclick=1; to the aI string which has the showmenu= that you want to openonclick. When you click the item, the submenu opens it will close when you mouse off the item that opened it, as long as your mouse is not actually on the submenu.

Ruth


Poster: sergio_101
Dated: Friday September 2 2005 - 15:32:36 BST

that is perfect!

thank you so much!

additional feature to openonclick


Poster: gjensen
Dated: Tuesday November 22 2005 - 15:33:09 GMT

I have tried to use the openonclick=1; on a feature I am trying to implement. This is used in a menu within the content area so I don't want mouse-over in this portion of the page. Oh yes... this menu works as a rollover, So all I need to do is change it to openonclick. Please advise.

Here is my code:

Code:
<script type="text/javascript">

with(milonic=new menuname("Main Menu")){
openonclick=1;
alwaysvisible=1;
itemheight=21;
itemwidth=150;
left=10;
position="relative";
orientation="horizontal";
style=menuStyle;
top=10;
aI("align=center;bgimage=itemblue.gif;overbgimage=itemyellow_on.gif;showmenu=sitestats;text=Site Statistics;");
}

with(milonic=new menuname("sitestats")){
openonclick=1;
itemheight=14;
itemwidth=426;
style=submenuStyle;
aI("text={exp:stats}This page has been viewed {hits} times<br />Page rendered in {elapsed_time} seconds<br />Total Entries: {total_entries}<br>Total Comments: {total_comments}<br />Total Trackbacks: {total_trackbacks}<br />Most Recent Entry: {last_entry_date format="%m/%d/%Y %h:%i %a"}<br />Most Recent Comment on:  {last_comment_date format="%m/%d/%Y %h:%i %a"}<br />Total Members: {total_members}<br />Total guests: {total_guests}<br />Total anonymous users: {total_anon}<br />Most Recent Visitor on:  {last_visitor_date format="%m/%d/%Y %h:%i %a"}<br />The most visitors ever was {most_visitors} on  {most_visitor_date format="%m/%d/%Y %h:%i %a"}{/exp:stats};");
}
drawMenus();
</script>


Poster: Andy
Dated: Tuesday November 22 2005 - 16:20:55 GMT

Hi,

You have included double quotes inside one of the aI strings, this will cause a conflict.

You can either change the double quotes to single quotes or you can escape the double quote by changing " to \"

Here is the faulty aI string; fixed:

aI("text={exp:stats}This page has been viewed {hits} times<br />Page rendered in {elapsed_time} seconds<br />Total Entries: {total_entries}<br>Total Comments: {total_comments}<br />Total Trackbacks: {total_trackbacks}<br />Most Recent Entry: {last_entry_date format='%m/%d/%Y %h:%i %a'}<br />Most Recent Comment on: {last_comment_date format='%m/%d/%Y %h:%i %a'}<br />Total Members: {total_members}<br />Total guests: {total_guests}<br />Total anonymous users: {total_anon}<br />Most Recent Visitor on: {last_visitor_date format='%m/%d/%Y %h:%i %a'}<br />The most visitors ever was {most_visitors} on {most_visitor_date format='%m/%d/%Y %h:%i %a'}{/exp:stats};");

Hope this helps,
Andy

incorrect answer???


Poster: gjensen
Dated: Tuesday November 22 2005 - 16:30:00 GMT

Andy,
Maybe I didn't clarify... My onclick does NOT work.
will your answer help this problem???

I will paste your code in.... but I don't understand how that will fix my problem.

Please advise...if your on the same thread as I am... if not... then help me adderss the above issue.

thanks for your patience.


Poster: Ruth
Dated: Tuesday November 22 2005 - 16:38:38 GMT

Hi,

Given your code, are you trying to open the sitestats onclick? If so, try putting the onclick into the main menu item that has the showmenu for sitestats

Code:
aI("align=center;bgimage=itemblue.gif;overbgimage=itemyellow_on.gif;showmenu=sitestats;text=Site Statistics;openonclick=1;");


Ruth

thanks!


Poster: gjensen
Dated: Tuesday November 22 2005 - 16:42:43 GMT

ruth... that did it.
thanks!