I\'m developing a web page in which I\'m using Twitter\'s Bootstrap Framework and their Bootstrap Tabs JS. It works great except for a few minor issues, one of which is I do
While the JavaScript solution provided may work, I went a slightly different way that requires no additional JavaScript, but does require logic in your view. You create a link with a standard URL parameter, like:
My Link
Then you simply detect the value of activeTab to write 'class="active"' in the appropriate
Pseudocode (implement accordingly in your language). Note I've set 'home' tab as a default active if no parameter provided in this example.
$activetabhome = (params.activeTab is null or params.activeTab == 'home') ? 'class="active"' : '';
$activetabprofile = (params.activeTab == 'profile') ? 'class="active"' : '';
- Home
- Profile