I’m currently using tabs with Twitter Bootstrap and want to select the same tab after a user has posted data and the page reloads.
How is this done?
My current call to inti the tabs looks like this:
<script type="text/javascript">
$(document).ready(function() {
$('#profileTabs a:first').tab('show');
});
</script>
My tabs:
<ul id="profileTabs" class="nav nav-tabs">
<li class="active"><a href="#profile" data-toggle="tab">Profile</a></li>
<li><a href="#about" data-toggle="tab">About Me</a></li>
<li><a href="#match" data-toggle="tab">My Match</a></li>
</ul>
You’ll have to use localStorage or cookies to manage that. Here’s a quick and dirty solution that can be vastly improved, but may give you a starting point: