Skip to content

Instantly share code, notes, and snippets.

@anwppro
Last active April 27, 2020 08:48
Show Gist options
  • Save anwppro/202fd2195ba615714612241eb6406610 to your computer and use it in GitHub Desktop.
Save anwppro/202fd2195ba615714612241eb6406610 to your computer and use it in GitHub Desktop.
Slick Example
<!-- Swiper main container -->
<div class="swiper-container" id="my-swiper-container">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
<div class="swiper-slide text-center pb-3"><img class="mx-auto" src="https://place-hold.it/50x80" alt=""><span class="d-block mt-2">Some Text</span></div>
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<!-- If we need scrollbar -->
<div class="swiper-scrollbar"></div>
</div>
<script>
( function( $ ) {
'use strict';
$( function() {
new Swiper( '#my-swiper-container', {
// Optional parameters
loop: true,
slidesPerView: 4,
// If we need pagination
pagination: {
el: '.swiper-pagination'
},
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev'
},
// And if we need scrollbar
scrollbar: {
el: '.swiper-scrollbar'
}
} );
} );
}( jQuery ) );
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment