Bootstrap 3 TAB link
Permalink
Hi,
I've implementing this nested TAB system on my website :
I try to link from another page ta a specific bootstrap TAB.
On the address link the tab ID appear right like this : #tab2 but the TAB system stay with the first tab active.
Any idea how to make this link work from another page than where is the TAB system?
C
I've implementing this nested TAB system on my website :
<div class="tabbable"> <!-- Only required for left/right tabs --> <ul class="nav nav-tabs responsive nav-justified" id="tabs"> <?php $tabs = $c->getAttribute('tabs'); for( $i=0; $i<$tabs; $i++ ) { if ($i == 0){ echo '<li class="active"><a data-toggle="tab" href="#tab' . $i . '" role="tab" >' . $c->getAttribute('tab_label' . $i). '<br><i class="fa '. $c->getAttribute('tab_icon' . $i).' fa-2x" aria-hidden="true"></i></a></li>'; } else { echo '<li><a data-toggle="tab" href="#tab' . $i . '" role="tab">' . $c->getAttribute('tab_label' . $i). '<br><i class="fa '. $c->getAttribute('tab_icon' . $i).' fa-2x" aria-hidden="true"></i></a></li>'; } } ?> </ul> <!-- Tab panes --> <div class="tab-content responsive" id="my-tab-content">
Viewing 15 lines of 29 lines. View entire code block.
I try to link from another page ta a specific bootstrap TAB.
On the address link the tab ID appear right like this : #tab2 but the TAB system stay with the first tab active.
Any idea how to make this link work from another page than where is the TAB system?
C
You could set it with javascript like this
So this javascript i have to put it in the footer.php file.
And any links that i will setup from a page without TAB system will send me to the right TAB on the page containing TAB system ?
And any links that i will setup from a page without TAB system will send me to the right TAB on the page containing TAB system ?
You could just use Magic Tabs. Multi-level tabs,linking to tabs and tab history are built in.
https://www.concrete5.org/marketplace/addons/magic-tabs1/...
https://www.concrete5.org/marketplace/addons/magic-tabs1/...