Created
December 1, 2016 07:25
-
-
Save milon/6ae8115219e0589b3fd2599c7a11dd5a to your computer and use it in GitHub Desktop.
This will add the tab's id appended to url as hash link, so that you can bookmark the tab.
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
| var url = document.URL; | |
| var hash = url.substring(url.indexOf('#')); | |
| $(".nav-tabs").find("li a").each(function(key, val) { | |
| if (hash == $(val).attr('href')) { | |
| $(val).click(); | |
| } | |
| $(val).click(function(ky, vl) { | |
| location.hash = $(this).attr('href'); | |
| }); | |
| }); |
Excellent. This worked great. Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works perfectly thank you !