Created
August 26, 2013 05:39
-
-
Save jwebcat/6338370 to your computer and use it in GitHub Desktop.
change css based on url hash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.location.hash.split('-')[0] == '#item') { | |
$('ul.side').addClass('hashed'); | |
} | |
// the below is questionable | |
$(function () { | |
if (window.location.hash) { | |
getHash(); | |
} | |
$(window).on("hashchange", function () { | |
getHash(); | |
}); | |
}); | |
function getHash() { | |
var loc = (window.location.hash).split("-"); | |
if (loc[0] == "#item") { | |
console.log("item found"); | |
// $('ul.side').addClass('hashed'); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment