Skip to content

Instantly share code, notes, and snippets.

@debiprasad
Forked from anonymous/custom.js
Last active September 9, 2015 08:04
Show Gist options
  • Save debiprasad/e35e72b72171d78ef021 to your computer and use it in GitHub Desktop.
Save debiprasad/e35e72b72171d78ef021 to your computer and use it in GitHub Desktop.
Opens a tab other than the active tab, when the page loads using the hash in the URL. Useful, if using Bootstrap tabs.
if (location.hash) {
var hashId = location.hash;
if ($('a[href="' + hashId + '"]').length > 0) {
$('a[href="' + hashId + '"]').click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment