jQuery tabs mimic
I was wondering if its possible to have jQuery Tabs that follows a parent tab!
To elabourate... I have a jquery tabs menu, 3 tabs, all working fine. there are divs for the tabs named 'tabs-1' and 'tabs-2' etc...
but what if I wanted another set of tabs in another place on the page that displayed the relative div according to the selected value of the tabs at the top of the page.
If that was confusing i shall elabourate further:
my jQuery tabs go like:
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>
<li><a href="#tabs-2">Proin dolor</a></li>
<li><a href="#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
<p>Proin elit arcu, rutrum</p>
</div>
<div id="tabs-2">
<p>Morbi tincidunt, dui sit amet</p>
</div>
<div id="tabs-3">
<p>Mauris eleifend est et turpis. </p>
<p>Duis cursus. Maecenas ligula eros</p>
</div>
and the list items correspond with the div id's.
What I want to know... is... is it possible to have THIS ^^^ AND have a separate piece of code with just the div elements
<div id="tabs-1">
<p>Proin elit arcu, rutrum</p>
</div>
<div id="tabs-2">
<p>Morbi tincidunt, dui sit amet</p>
</div>开发者_如何学Go;...
that show or Mimic the display of the other one.
so if the main tab is on heading2, (tabs-2), the other separate div would display tabs-2?
easy to do??
Cheers,
Alex
You could give them a common class (for example: .theTabs
) and bind to the show event of the tabs:
$( ".theTabs" ).bind( "tabsshow", function(event, ui) {
//your div manipulation here
});
Inside there you can then select by the unique ID and manipulate the other tab representation accordingly
精彩评论