Skip to content

Instantly share code, notes, and snippets.

@rwaddin
Created July 10, 2020 03:10
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 rwaddin/e98aec4d3cf5748b0cc797d2e5a4740b to your computer and use it in GitHub Desktop.
Save rwaddin/e98aec4d3cf5748b0cc797d2e5a4740b to your computer and use it in GitHub Desktop.
ketika redirect langsung buka tab sesuai url
// ref : https://stackoverflow.com/questions/43584707/bootstrap-tab-throws-dataoption-is-not-a-function-error
jQuery(document).ready(function($) {
// Javascript to enable link to tab
var url = document.location.toString();
if (url.match('#')) {
var name = url.split('#')[1]
$('.nav-tabs a[href="#' + name + '"]').tab('show');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment