Tuesday, April 19, 2016

Slick carousel. Want autoplay to play the slides

<div class="column-right slide">
    <div><img src="img/servicios/road.jpg" alt="Road"/></div>
    <div><img src="img/sobre_mi/map.jpg" alt="Map"/></div>

var slider = $('.slide').slick({
    autoplay: true,
    autoplaySpeed: 1000,
    dots: false,
    infinite: false,
    speed: 1000,
    fade: true,
    slide: 'div',
    cssEase: 'linear',
    onAfterChange: function(){
        //check the length of total items in .slide container
        //if that number is the same with the number of the last slide
        //Then pause the slider
        if( item_length == slider.slickCurrentSlide() ){
            //this should do the same thing -> slider.slickPause();

No comments:

Post a Comment