Skip to content

Instantly share code, notes, and snippets.

@qichunren
Created July 20, 2011 02:33
Show Gist options
  • Select an option

  • Save qichunren/1094213 to your computer and use it in GitHub Desktop.

Select an option

Save qichunren/1094213 to your computer and use it in GitHub Desktop.
mark url location history( ajax history)
// mark current location url
$("#nav_ticker").click(function(){
$("#nav ul li").removeClass("active");
$(this).addClass("active");
window.location.hash = "tickers/cp";
});
$("#nav_announce").click(function(){
$("#nav ul li").removeClass("active");
$(this).addClass("active");
window.location.hash = "current_route";
});
$("#nav_tv").click(function(){
$("#nav ul li").removeClass("active");
$(this).addClass("active");
window.location.hash = "tvs/cp";
});
$("#nav_settings").click(function(){
$("#nav ul li").removeClass("active");
$(this).addClass("active");
window.location.hash = "settings/cp";
});
$("#nav_about").click(function(){
$("#nav ul li").removeClass("active");
$(this).addClass("active");
window.location.hash = "about";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment