tags:

views:

44

answers:

3

I would like to know how to make a link on a navigation menu stay selected when you have clicked on it? A good tutorial or example would be nice:)

A: 

you can use in this link apycom.com. i'm a newbie too.and i have used this for my page.

klox
+1  A: 

Hello jackASS, I happen to have some computer codes that do exactly this.

a.selected {
  background-color:#1F75CC;
  color:white;
}

$("a").live('click', function() {
  $("a").removeClass("selected");
  $(this).addClass("selected");
  return false;
});
Andy Gaskell
A: 
$('a[href="'+window.location.href+'"]').addClasss('currentPage');

This should do the trick. The condition is to have full path.

However, the right way is to generate correct code from the server side.

Ionut Staicu