Owl Carousel 2 is a fully responsive and super customizable jQuery plugin that helps to create the most powerful touch and drag enabled carousel for modern websites. Owl Carousel has a lot of options and events and anyone can configure it easily. You can find a very basic styling of the carousel but it can be modified easily with the help of CSS as you need.
Remember that the plugin is now DEPRECATED. Check out our Slider section for more Carousel plugins.
1. Include the Javascript owl.carousel.min.js
at the bottom of the web page.
<script src="path/to/owl.carousel.min.js"></script>
2. Include the CSS owl.carousel.min.css
in the header of the page.
<link rel="stylesheet" href="path/to/owl.carousel.min.css">
3. Include the CSS owl.theme.default.min.css
for default predefined styling for the carousel.
<link rel="stylesheet" href="path/to/owl.theme.default.min.css">
4. Include the CSS animate.css if you need custom animation for the carousel.
<link rel="stylesheet" href="path/to/animate.css">
5. Add the basic HTML to the page.
<div class="owl-carousel owl-theme">
<div class="item"><h4>1</h4></div>
<div class="item"><h4>2</h4></div>
<div class="item"><h4>3</h4></div>
</div>
6. Initialize the plugin and we're ready to go.
$('.owl-carousel').owlCarousel({
loop:true,
margin:10,
nav:true,
responsive:{
0:{
items:1
},
600:{
items:3
},
1000:{
items:5
}
}
});
<div class="owl-carousel owl-theme basic">
<div class="item"><h4>1</h4></div>
<div class="item"><h4>2</h4></div>
<div class="item"><h4>3</h4></div>
</div>
$('.basic').owlCarousel({
loop:true,
margin:10,
nav:true,
responsive:{
0:{
items:1
},
600:{
items:3
},
1000:{
items:5
}
}
});
<div class="owl-carousel owl-theme loop-center">
<div class="item"><h4>1</h4></div>
<div class="item"><h4>2</h4></div>
<div class="item"><h4>3</h4></div>
</div>
$('.loop-center').owlCarousel({
center: true,
items:2,
loop:true,
margin:10,
responsive:{
600:{
items:4
}
}
});
<div class="owl-carousel owl-theme nonloop-center">
<div class="item"><h4>1</h4></div>
<div class="item"><h4>2</h4></div>
<div class="item"><h4>3</h4></div>
</div>
$('.nonloop-center').owlCarousel({
center: true,
items:2,
loop:false,
margin:10,
responsive:{
600:{
items:4
}
}
});
<div class="owl-carousel owl-theme merge">
<div class="item" data-merge="1"><h2>1</h2></div>
<div class="item" data-merge="2"><h2>2</h2></div>
<div class="item" data-merge="1"><h2>3</h2></div>
<div class="item" data-merge="3"><h2>4</h2></div>
<div class="item" data-merge="6"><h2>6</h2></div>
<div class="item" data-merge="2"><h2>7</h2></div>
<div class="item" data-merge="1"><h2>8</h2></div>
<div class="item" data-merge="3"><h2>9</h2></div>
<div class="item"><h2>10</h2></div>
<div class="item"><h2>11</h2></div>
<div class="item" data-merge="2"><h2>12</h2></div>
<div class="item"><h2>13</h2></div>
<div class="item"><h2>14</h2></div>
<div class="item"><h2>15</h2></div>
</div>
$('.merge').owlCarousel({
items:5,
loop:true,
margin:10,
merge:true,
responsive:{
678:{
mergeFit:true
},
1000:{
mergeFit:false
}
}
});
<div class="owl-carousel owl-theme auto-width">
<div class="item" style="width:250px"><h4>1</h4></div>
<div class="item" style="width:100px"><h4>2</h4></div>
<div class="item" style="width:500px"><h4>3</h4></div>
........
</div>
$('.auto-width').owlCarousel({
margin:10,
loop:true,
autoWidth:true,
items:4
})
<div class="owl-carousel owl-theme stage-padding">
<div class="item"><h4>1</h4></div>
<div class="item"><h4>2</h4></div>
<div class="item"><h4>3</h4></div>
..........
</div>
$('.stage-padding').owlCarousel({
stagePadding: 50,
loop:true,
margin:10,
nav:true,
responsive:{
0:{
items:1
},
600:{
items:3
},
1000:{
items:5
}
}
})
<div class="owl-carousel owl-theme animate">
<div class="item"><h4>1</h4></div>
<div class="item"><h4>2</h4></div>
<div class="item"><h4>3</h4></div>
..........
</div>
$('.animate').owlCarousel({
animateOut: 'slideOutDown',
animateIn: 'flipInX',
items:1,
margin:30,
stagePadding:30,
smartSpeed:450
});