Open liammcsheffrey opened 9 years ago
(with jQuery) I use
$(window).on('hashchange', function(e){ // code to switch bootstrap tabs });
Based on the answer from the following SO question...
https://stackoverflow.com/questions/17830590/bootstrap-tab-activation-with-jquery
your implementation could look something like:
// detect hashchange
$(window).on('hashchange', function(e){
// clean #hash
var hash = window.location.hash.substr(1);
// "show" the tab with #{hash} url
$('.nav-tabs a[href="#' + hash + '"]').tab('show');
});
Hi, I'm trying to set up crossroads.js to work with bootstrap tabs, so a URL may be /mainpage#latestnews
Looking at hasher and history.js, is there an example as to how this can work and how hash tab routes can be created?
Thanks