Websolutionstuff

How to Create Slider using jQuery

In this post we will see how to create slider using jquery, here we will use owl carousel for create slider using bootstrap. owl.carousel provides inbuilt css and js for jquery automatic image slider. here we will see how to create slidshow or how to create image slider using jquery.

Here, you need to add owl.carousel css and owl.carousel js for slider, so let’s see how to create slidshow using owl.carousel.

Add CSS

first of all we need to add two css in your head section.

<link rel="stylesheet" href="owlcarousel/owl.carousel.min.css"> // required
<link rel="stylesheet" href="owlcarousel/owl.theme.default.min.css"> // optional

Add JS

Now, add jquery and owl.carousel.min.js into the footer.

<script src="jquery.min.js"></script>
<script src="owlcarousel/owl.carousel.min.js"></script>

Add in HTML File

In HTML file you need to just add class in <div>,<a>,<img> tags like below.

<div class="owl-carousel">
<div> your content 1</div>
<div> your content 2</div>
<div> your content 3</div>
</div>

After that you need to initializer owl function using jquery script.

$(document).ready(function(){
$(".owl-carousel").owlCarousel();
});

Now, you can run simple slider.so, let’s see other example of slider.

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API.