Skip to content

Instantly share code, notes, and snippets.

@ericalli
Created May 31, 2012 17:21
Show Gist options
  • Save ericalli/2844861 to your computer and use it in GitHub Desktop.
Save ericalli/2844861 to your computer and use it in GitHub Desktop.
Open /javascripts/fluidapp.js and find the following snippet of code:
// Main Navigation
var FluidNav = {
init: function() {
$("a[href*=#]").click(function(e) {
e.preventDefault();
if($(this).attr("href").split("#")[1]) {
FluidNav.goTo($(this).attr("href").split("#")[1]);
}
});
this.goTo("home");
},
Replace with:
// Main Navigation
var FluidNav = {
init: function() {
$("a[href*=#]").click(function(e) {
e.preventDefault();
if($(this).attr("href").split("#")[1]) {
FluidNav.goTo($(this).attr("href").split("#")[1]);
location.hash = $(this).attr("href").split("#")[1];
}
});
var hash = window.location.hash;
if(hash) {
FluidNav.goTo(hash.substring(1));
} else {
this.goTo("home");
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment