submenus - clicking to open..

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
sergio_101
Advanced
Advanced
Posts: 24
Joined: Mon Jul 18, 2005 4:05 pm

submenus - clicking to open..

Post by sergio_101 »

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!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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

Ruth
sergio_101
Advanced
Advanced
Posts: 24
Joined: Mon Jul 18, 2005 4:05 pm

Post by sergio_101 »

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?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
Last edited by Ruth on Fri Sep 02, 2005 4:10 pm, edited 1 time in total.
sergio_101
Advanced
Advanced
Posts: 24
Joined: Mon Jul 18, 2005 4:05 pm

Post by sergio_101 »

that is perfect!

thank you so much!
gjensen
Advanced
Advanced
Posts: 18
Joined: Fri Mar 04, 2005 2:38 pm

additional feature to openonclick

Post by gjensen »

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: Select all

<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>
George
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

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
gjensen
Advanced
Advanced
Posts: 18
Joined: Fri Mar 04, 2005 2:38 pm

incorrect answer???

Post by gjensen »

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.
George
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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: Select all

aI("align=center;bgimage=itemblue.gif;overbgimage=itemyellow_on.gif;showmenu=sitestats;text=Site Statistics;openonclick=1;"); 
Ruth
gjensen
Advanced
Advanced
Posts: 18
Joined: Fri Mar 04, 2005 2:38 pm

thanks!

Post by gjensen »

ruth... that did it.
thanks!
George
Post Reply