Making a Responsive Image Carousel
25 Jun 2015What is OWL Carousel?
OWL is a jQuery plugin that results in great looking and mobile friendly image carousels for the website you are building. It comes with many options including touch controls, multiple images, slider timer and responsive layout. Also it doesn’t take that long to set up.
Download
First thing is first, lets get the code. The plugin can be downloaded here.
Let’s Get Started
In this tutorial we’ll be setting up a full width, responsive, multi-image carousel with touch for mobile.
Get an HTML document going and go ahead and link all the CSS and Javascript to your HTML document. In the header include the following links:
We’ll add our script src tags in the header. This will make the JS a bit more predictable.
(Note: The version of jQuery you use will vary, so change your ‘src’ accordingly)
Add The Content
Within the body tag, include a div for the carousel and its contents. This is were we include out images, you can use which ever ones you would like.
We Need A Little Javascript Magic
Below the content we’ll want to intiate some Javascript..
‘autoPlay’ is determining how long the carousel waits before transistioning.
‘items : 3’ is stating how many images to show side by side at the largest screen setting.
Final Markup
Your final markup should look similiar to the following. Play around with the values to get a different result.
End Result
Here is my example on mobile..