I am trying to build a page using both bootstrap and a Owl carousel, Owl carousel fit the purpose of the site rather that bootstraps version. So I got a tab structure where I want to put a carousel on each page, however all my attempts have failed. Here is my code
<div role=tabpanel>
<!-- Nav tabs -->
<ul class=nav nav-tabs role=tablist>
<li role=presentation class=active><a href=#home aria-controls=home role=tab data-toggle=tab>Home</a></li>
<li role=presentation><a href=#profile aria-controls=profile role=tab data-toggle=tab>Profile</a></li>
<li role=presentation><a href=#messages aria-controls=messages role=tab data-toggle=tab>Messages</a></li>
<li role=presentation><a href=#settings aria-controls=settings role=tab data-toggle=tab>Settings</a></li>
</ul>
<!-- Tab panes -->
<div class=tab-content>
<div role=tabpanel class=tab-pane active id=home>
<div class=owl-carousel id=owl1>
<div> content</div>
<div> content</div>
</div>
</div>
<div role=tabpanel class=tab-pane id=profile>
<div class=owl-carousel id=owl2>
<div> content</div>
<div> content</div>
</div>
<div role=tabpanel class=tab-pane id=messages>
<div class=owl-carousel id=owl3>
<div> content</div>
<div> content</div>
</div>
</div>
<div role=tabpanel class=tab-pane id=settings>
<div class=owl-carousel id=owl4>
<div> content</div>
<div> content</div>
</div>
</div>
</div>
</div>
Here is my javascript
$(document).ready(function () {
$('#owl1').owlCarousel({
loop: true,
margin: 10,
responsiveClass: true,
responsive: {
0: {
items: 1,
nav: true
},
600: {
items: 1,
nav: false
},
1000: {
items: 1,
nav: true,
loop: false
}
}
});
$('#owl2').owlCarousel({
loop: true,
margin: 10,
responsiveclass: true,
responsive: {
0: {
items: 1,
nav: true
},
600: {
items: 1,
nav: false
},
1000: {
items: 1,
nav: true,
loop: false
}
}
});
$('#owl3').owlCarousel({
loop: true,
margin: 10,
responsiveclass: true,
responsive: {
0: {
items: 1,
nav: true
},
600: {
items: 1,
nav: false
},
1000: {
items: 1,
nav: true,
loop: false
}
}
});
$('#owl4').owlCarousel({
loop: true,
margin: 10,
responsiveclass: true,
responsive: {
0: {
items: 1,
nav: true
},
600: {
items: 1,
nav: false
},
1000: {
items: 1,
nav: true,
loop: false
}
}
});
//});
http://www.owlcarousel.owlgraphic.com/docs/api-events.html