I'm managing two separate tab boxes that switch content when clicked or over a 5-second period.
https://i.sstatic.net/Ujz9H.jpg https://i.sstatic.net/sFc1K.jpg
The left box is functioning correctly, but the right box is changing the active state without updating the content.
Here's the HTML for the left box:
<div class="media">
<div class="parrent pull-left">
<ul class="nav nav-tabs nav-stacked">
<li class=""><a href="#tab1" data-toggle="tab" class="analistic-01">Architect</a></li>
<li class=""><a href="#tab2" data-toggle="tab" class="analistic-03">AIA</a></li>
<li class=""><a href="#tab3" data-toggle="tab" class="tehnical">IRS </a></li>
<li class=""><a href="#tab4" data-toggle="tab" class="tehnical">AKIN GUMP</a></li>
<li class=""><a href="#tab5" data-toggle="tab" class="tehnical">PWC</a></li>
<li class=""><a href="#tab6" data-toggle="tab" class="tehnical">EPA</a></li>
</ul>
</div>
<div class="parrent media-body">
<div class="tab-content">
<div class="tab-pane fade" id="tab1">
<div class="media">
<div class="pull-left boxImg">
<a href="http://www.architectmagazine.com/awards/r-d-awards/award-green-zip-tape_o"><img class="img-responsive" src="images/Awards/R&D.png"></a>
<a href="http://www.architectmagazine.com/awards/r-d-awards/award-green-zip-tape_o">Click for Award</a>
</div>
<div class="media-body">
<h2>Architect Magazine</h2>
<p>It’s hard to get simpler in conception and execution than Green-Zip Tape. The product is a substitute for the joint-compound tape that has been used between gypsum board panels since the introduction of prefabricated plasterboard in the early 1930s. The product impressed all three jurors.</p>
</div>
</div>
</div>
<!-- Other tab panes omitted for brevity -->
</div>
</div>
</div>
HTML for the right box:
<div class="media">
<div class="parrent pull-left">
<ul class="nav nav-tabs nav-stacked nav-two">
<li class=""><a href="#set1" data-toggle="tab" class="analistic-01">Marek</a></li>
<li class=""><a href="#set2" data-toggle="tab" class="analistic-02">Ozarks Bank</a></li>
<li class=""><a href="#set3" data-toggle="tab" class="tehnical">CBRE </a></li>
<li class=""><a href="#set4" data-toggle="tab" class="tehnical">Habitat</a></li>
<li class=""><a href="#set5" data-toggle="tab" class="tehnical">Huffman</a></li>
<li class=""><a href="#set6" data-toggle="tab" class="tehnical">Holiday</a></li>
</ul>
</div>
<div class="parrent media-body">
<div class="tab-content">
<div class="tab-pane fade" id="set1">
<div class="media">
<div class="pull-left boxImg">
<a href="Ref/Marek.pdf"><img class="img-responsive" src="images/Referals/MarekBrothers.jpg"></a>
<a href="Ref/Marek.pdf">Click for Reference</a>
</div>
<div class="media-body">
<h2>Marek</h2>
<p>We recently built our new headquarters building using the Green-Zip Partition System everywhere. To me, it’s a simple solution that everyone should take advantage of!
<br>
-<b>R. Stan Marek</b>, Chairman
</p>
</div>
</div>
</div>
<!-- Other tab panes omitted for brevity -->
</div>
</div>
</div>
And here is the JavaScript:
var cycle = {
onReady: function() {
$(".nav-stacked li:first").addClass("active in");
$("#tab1").addClass("active in");
setInterval(function() {
var $navStacked = $("li.active");
var tabContent = $("li.active a").attr("href");
if ($navStacked.is(".nav-stacked li:last-child")) {
$navStacked.removeClass("active in");
$(".nav-stacked li:first").addClass("active in");
$("div " + tabContent).removeClass("active in");
$("div#tab1").addClass("active in");
} else {
$navStacked.removeClass("active in").next().addClass("active in");
$("div " + tabContent).removeClass("active in").next().addClass("active in");
}
}, 5000);
}
};
$(document).ready(cycle.onReady);
var cycle2 = {
onReady: function() {
$(".nav-two li:first").addClass("active in");
$("#set1").addClass("active in");
setInterval(function() {
var $navStacked2 = $("li.active");
var tabContent2 = $("li.active a").attr("href");
if ($navStacked2.is(".nav-two li:last-child")) {
$navStacked2.removeClass("active in");
$(".nav-two li:first").addClass("active in");
$("div " + tabContent2).removeClass("active in");
$("div#set1").addClass("active in");
} else {
$navStacked2.removeClass("active in").next().addClass("active in");
$("div " + tabContent2).removeClass("active in").next().addClass("active in");
}
}, 5000);
}
};
$(document).ready(cycle2.onReady);
The script 'cycle' controls the left box, while the script 'cycle2' is meant to control the right one.
If you need more information, check out the original JSFiddle.