jQuery
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<script src="slick.min.js"></script> <script> $(document).ready(function(){ var $status = $('.slidecounter'); var $slickElement = $('.slider'); $slickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { var i = (currentSlide ? currentSlide : 0) + 1; $status.text(i + '/' + slick.slideCount); }); $slickElement.slick({ centerMode: true, infinite: true, autoplay: true, dots: true, centerPadding:'150px', slidesToShow: 1, responsive: [ { breakpoint: 768, settings: { centerMode: true, centerPadding: '0', slidesToShow: 2 } }, { breakpoint: 480, settings: { arrows: false, centerMode: true, centerPadding: '0', slidesToShow: 1 } }] }); }); </script> |
コメント