PDA

View Full Version : How to change color of menu bar to reflect current page?


dennis-dunnwald325143
06-08-2009, 09:36 AM
How do you change the color of the global navigation to reflect the current page that you are visiting. Is this done with CSS, if so how, or is some type of script that needs to be added?

Here is an example http://dermatology.stanford.edu/


Many thanks in advance for your help,
Dennis

Ray Borduin
06-08-2009, 09:56 AM
There should be a checkbox option in the Menu Writer v2 user interface to do this for you.

dennis-dunnwald325143
06-08-2009, 12:05 PM
Thanks Ray,

I found the check box.
Dennis

jk419811
12-28-2010, 04:52 PM
Hi, I found this in the old threads. Every time I try to go back into the user interface everything gets all screwed up. Can you show me how to do this in the code?

Thanks!

Jennifer

Ray Borduin
12-29-2010, 08:00 AM
It should be added to the javascript where your menu is created immediately below the menu html on the included page at the very bottom.


<script type="text/javascript">if(window.attachEvent) { window.attachEvent("onload", function() { cssmw.intializeMenu('cssmw',{select_current: 1, orientation: 1}); }); } else if(window.addEventListener) { window.addEventListener("load", function() { cssmw.intializeMenu('cssmw',{select_current: 1, orientation: 1}); }, true); }</script>

The select_current argument will be set to 0 for a menu that doesn't highlight the current page.

jk419811
12-29-2010, 09:39 AM
That totally worked!

thanks!

Jennifer