PDA

View Full Version : Switch Menu - Highlight Current Menu Item?



magruth
06-30-2006, 03:34 PM
I am using the Switch Menu
http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm

I really like it, but would like to be able to have the current selected menu item stay highlighted so the user knows where they are.

If anyone knows how to modify the code to support this, I would really appreciate sharing this with me!

Thanks

jolly_jonesy
03-23-2007, 10:51 PM
Yes I have ask his many times now... especially for the submenu items, the lack of replies signals that either it can't be done or its a tad difficult for the developers... lets hope they respond soon because it would really be the icing on the cake to a very nice menu sript..

steve

jolly_jonesy
01-03-2008, 03:00 PM
IS ANYONE EVER GOING TO COM UP WITH AN ANSWER?...

Must be a real toughy

lex2000
02-07-2008, 08:34 PM
Yeah, no kidding. Now there are at least 3 of us who want to be able to do this. It can't be that difficult for people who write these scripts, can it?

student101
04-20-2008, 07:02 AM
I am using the Switch Menu
http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm
I really like it, but would like to be able to have the current selected menu item stay highlighted so the user knows where they are.
If anyone knows how to modify the code to support this, I would really appreciate sharing this with me!
Thanks

It's all CSS based.
Add a new id or class selector, call it current.

So it's like this:


.menutitle{
cursor:pointer;
margin-bottom: 5px;
background-color:#ECECFF;
color:#000000;
width:140px;
padding:2px;
text-align:center;
font-weight:bold;
}

.submenu{
margin-bottom: 0.5em;
}

#current{
cursor:pointer;
margin-bottom: 5px;
background-color:#FF0000;
color:#FFFFFF;
width:140px;
padding:2px;
text-align:center;
font-weight:bold;
}

So you add it like this in RED.

<div class="menutitle" onclick="SwitchMenu('sub1')" id="current">Site Menu</div>

Have you guys had any experience with HTML, CSS?

Anyways if you want it dynamic, do this:
Dynamic_Menu_Highlighting (http://codex.wordpress.org/Dynamic_Menu_Highlighting)

This is better:
current_menu_state_with_css/ (http://www.456bereastreet.com/archive/200503/setting_the_current_menu_state_with_css/)

Cheers