0

I'm sure many of you are aware of the jQuery LavaLamp: http://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/

I know that I can make the class="current" of my li tag if I want to manually select what option is selected, but is their a way I can choose what menu item is selected depending on what parameter is shown in the address bar (i.e. index.html#page-1, #page-2, #page-3...).

Thanks to anyone who can help me out!

JosephFTaylor
  • 99
  • 2
  • 11

1 Answers1

0

You can use the window.location.hash as the selector so something like this:

if ("" != window.location.hash) {
    $(window.location.hash).addClass("current");
}

That should give you the desired result.

Tarek Fadel
  • 1,909
  • 1
  • 14
  • 22