Reputation: 169
I am trying to place Tabs in the header, but want them to control the content in an adjacent containers. Is this possible if the both Tabs+Content are not nested within the same DIV tags?
$(function() {
$( ".tabs" ).tabs
});
<header>
<div class="tabs">
<ul>
<li><a href="#links">Links</a></li>
<li><a href="#filters">Filter</a></li>
</ul>
</div>
</header>
<div id="container" class="tabs">
<div id="links">
Stuff in here
</div>
<div id="filters">
Stuff in here
</div>
</div>
Upvotes: 1
Views: 1274
Reputation: 1103
Check below example hope you are expecting similar option.
HTML
<div id="pagewraper">
<header>
<ul class="menu">
<li><a href="#tabs-1">Menu one</a></li>
<li><a href="#tabs-2">Menu two</a></li>
<li><a href="#tabs-3">Menu three</a></li>
</ul>
</header>
<div id="container">
<div id="tabs-1">
<p>Tab one content</p>
</div>
<div id="tabs-2">
<p>Tab two content</p>
</div>
<div id="tabs-3">
<p>Tab three content</p>
</div>
</div>
</div>
CSS
ul.menu{
margin:0;
padding:0;
}
ul.menu li{
display: inline-block;
}
ul.menu li a{
display: block;
padding: 10px;
background: #333;
color: #fff;
}
jQuery
$( "#pagewraper" ).tabs();
Upvotes: 3