I built 2 responsive Owl-carousel-v2 in a page which look perfect. After I put them into tabs, the first one carousel works but the one behind tab panel lost it's item width, and I couldn't make it work. If I have all the items with a certain width then all items will be listed vertically.
Here is my demo pen: http://codepen.io/bard/pen/NxqyQy/
I guess the problem is item width are calculated when the page loads.
How to solve this?
HTML:
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#track1">Track1</a></li>
<li><a data-toggle="tab" href="#track2">Track2</a></li>
</ul>
<div class="panel tab-content">
<div id="track1" class="panel-body tab-pane fade in active">
<div class="container-fluid tracker">
<div class="wrapper-with-margin">
<div id="owl-demo" class="owl-carousel">
<div class="item" style="">1</div>
<div class="item" style="">2</div>
<div class="item" style="">3</div>
<div class="item" style="">4</div>
<div class="item" style="">5</div>
<div class="item" style="">6</div>
<div class="item" style="">7</div>
<div class="item" style="">8</div>
<div class="item" style="">9</div>
</div>
</div>
</div>
</div>
<div id="track2" class="panel-body tab-pane fade">
<div class="container-fluid tracker">
<div class="wrapper-with-margin">
<div id="owl-demo2" class="owl-carousel">
<div class="item" style="">9</div>
<div class="item" style="">8</div>
<div class="item" style="">7</div>
<div class="item" style="">6</div>
<div class="item" style="">5</div>
<div class="item" style="">4</div>
<div class="item" style="">3</div>
<div class="item" style="">2</div>
<div class="item" style="">1</div>
</div>
</div>
</div>
</div>
</div>