Skip to content

Instantly share code, notes, and snippets.

@BrunoQuaresma
Last active December 31, 2015 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrunoQuaresma/7944254 to your computer and use it in GitHub Desktop.
Save BrunoQuaresma/7944254 to your computer and use it in GitHub Desktop.
You can use links generates by tabs like users/show/2#edit.
/**
* Bootstrap Nav Tabs
*
* Completely navigation with tabs and URL.
*/
function navTabs(){
$('*[href=' + window.location.hash + ']').tab('show');
$('*[data-toggle=tab]').on('click',function(){
var me = $(this),
href = me.attr('href');
$('.nav-tabs').find('*[href=' + href + ']').tab('show');
document.location = href;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment