A Pen by Satveer Singh Randhawa on CodePen.
Created
May 24, 2019 14:41
-
-
Save Thajas/dc7e5aed55aa138dd58407a56aeaaa0e to your computer and use it in GitHub Desktop.
Owl Carousel owl slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="carousel" class="owl-carousel"> | |
<div class="item"> | |
<img class="owl-lazy" data-src="https://i.pinimg.com/originals/84/67/26/846726299dc5abbeb5d60016f0fb32e9.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="http://desktop-backgrounds-org.s3.amazonaws.com/400x300/twitter-nature-high-definition.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="https://i.pinimg.com/originals/84/67/26/846726299dc5abbeb5d60016f0fb32e9.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="http://desktop-backgrounds-org.s3.amazonaws.com/400x300/twitter-nature-high-definition.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="https://i.pinimg.com/originals/84/67/26/846726299dc5abbeb5d60016f0fb32e9.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="http://desktop-backgrounds-org.s3.amazonaws.com/400x300/twitter-nature-high-definition.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="https://i.pinimg.com/originals/84/67/26/846726299dc5abbeb5d60016f0fb32e9.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="http://desktop-backgrounds-org.s3.amazonaws.com/400x300/twitter-nature-high-definition.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="https://i.pinimg.com/originals/84/67/26/846726299dc5abbeb5d60016f0fb32e9.jpg" alt=""> | |
</div> | |
<div class="item"> | |
<img class="owl-lazy" data-src="http://desktop-backgrounds-org.s3.amazonaws.com/400x300/twitter-nature-high-definition.jpg" alt=""> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#carousel").owlCarousel({ | |
autoplay: true, | |
lazyLoad: true, | |
loop: true, | |
margin: 20, | |
/* | |
animateOut: 'fadeOut', | |
animateIn: 'fadeIn', | |
*/ | |
responsiveClass: true, | |
autoHeight: true, | |
autoplayTimeout: 7000, | |
smartSpeed: 800, | |
nav: true, | |
responsive: { | |
0: { | |
items: 1 | |
}, | |
600: { | |
items: 3 | |
}, | |
1024: { | |
items: 4 | |
}, | |
1366: { | |
items: 4 | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.owl-nav button { | |
position: absolute; | |
top: 50%; | |
background-color: #000; | |
color: #fff; | |
margin: 0; | |
transition: all 0.3s ease-in-out; | |
} | |
.owl-nav button.owl-prev { | |
left: 0; | |
} | |
.owl-nav button.owl-next { | |
right: 0; | |
} | |
.owl-dots { | |
text-align: center; | |
padding-top: 15px; | |
} | |
.owl-dots button.owl-dot { | |
width: 15px; | |
height: 15px; | |
border-radius: 50%; | |
display: inline-block; | |
background: #ccc; | |
margin: 0 3px; | |
} | |
.owl-dots button.owl-dot.active { | |
background-color: #000; | |
} | |
.owl-dots button.owl-dot:focus { | |
outline: none; | |
} | |
.owl-nav button { | |
position: absolute; | |
top: 50%; | |
transform: translateY(-50%); | |
background: rgba(255, 255, 255, 0.38) !important; | |
} | |
span { | |
font-size: 70px; | |
position: relative; | |
top: -5px; | |
} | |
.owl-nav button:focus { | |
outline: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment