A Pen by Swetank Rathi on CodePen.
Created
November 30, 2022 05:11
-
-
Save mitesh9991/dcfb65c7fba852c9d78de4249af03875 to your computer and use it in GitHub Desktop.
Slick carousel example
This file contains hidden or 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 class="wrapper"> | |
<h2>Slick Carousel Example<h2> | |
<div class="carousel"> | |
<div><img src="https://picsum.photos/300/200?random=1"></div> | |
<div><img src="https://picsum.photos/300/200?random=2"></div> | |
<div><img src="https://picsum.photos/300/200?random=3"></div> | |
<div><img src="https://picsum.photos/300/200?random=4"></div> | |
<div><img src="https://picsum.photos/300/200?random=5"></div> | |
<div><img src="https://picsum.photos/300/200?random=6"></div> | |
</div> | |
</div> |
This file contains hidden or 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
$(document).ready(function(){ | |
$('.carousel').slick({ | |
slidesToShow: 3, | |
dots:true, | |
centerMode: true, | |
}); | |
}); | |
// Slick version 1.5.8 |
This file contains hidden or 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="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.8/slick.min.js"></script> |
This file contains hidden or 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
html, body{ | |
background-color: #e74c3c; | |
} | |
.wrapper{ | |
width:100%; | |
padding-top: 20px; | |
text-align:center; | |
} | |
h2{ | |
font-family:sans-serif; | |
color:#fff; | |
} | |
.carousel{ | |
width:90%; | |
margin:0px auto; | |
} | |
.slick-slide{ | |
margin:10px; | |
} | |
.slick-slide img{ | |
width:100%; | |
border: 2px solid #fff; | |
} | |
.wrapper .slick-dots li button:before { | |
font-size:20px; | |
color:white; | |
} |
This file contains hidden or 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="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.8/slick.min.css" rel="stylesheet" /> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.8/slick-theme.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment