PDA

View Full Version : Always on button? (MLM #2)



paganpete
09-09-2009, 04:40 PM
1) Script Title: jQuery Multi Level CSS Menu #2

2)Script link: http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2/

3) Describe problem:

Hi all, new to the site but have heard you are all really helpful!

I have a problem with the 3 level DD menu here;

http://www.dynamicdrive.com/style/cs...el_css_menu_2/

It all works fine but what I need to do is have the current page button highlighted for whichever page the viewer is on (for instance the off state is grey and on state is orange on mouseover - but if they navigate to the contact page (eg) I want the link to stay orange (not go back to grey)- I really have no idea on this (have looked at other css where this is done but it will not work on mine)?

Help REALLY appreciated!

TIA.

Pete

Johnathan
09-14-2009, 02:28 PM
Understand the frustration. Try opening your "ddsmoothmenu.css" file and find the following line


.ddsmoothmenu ul li a.selected{ /*CSS class that's dynamically added to the currently active menu items' LI A element*/
background: black;
color: white;
}


change: background: orange (or hex equiv.)

This will make the background turn orange -- if you want the text a different colour, change the "color: white;" line.

Hope that this helps.

ddadmin
09-14-2009, 08:05 PM
Actually, the CSS code Johnathan posted refers to that found inside DD Smooth Menu (http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm), and not jQuery Multi Level CSS Menu #2. Regardless though, the OP is asking about something different if I understood correctly. He means how to have the main menu item corresponding to the current page be selected. There's no way for the script to automatically determine that relationship and highlight the menu item in question unfortunately. Normally you would either manually apply a CSS class on each page to the correct menu item, or make that determination using server side scripting, before the HTML of the page is even output.