G
G
grishaaa2016-12-22 13:03:57
JavaScript
grishaaa, 2016-12-22 13:03:57

How to make one scroll slider and stop it?

It is necessary that when you click on the button that will open the block with the slider, the slide scrolls once immediately and then the scrolling stops. I don't know how to write it in jquery
Here is the button that will be clicked. There will be a lot of buttons, so when you click on another button, scrolling in the slider works once again.

jQuery('.sect_2_catalog a').on('click',function(){
      
            var scroll_el = jQuery(this).attr('href');
          
            
          });

Here is the slider code
jQuery('.slider').slick({
    dots: false,
    infinite: true,
    speed: 500,
    autoplaySpeed: 1000,
    autoplay: false,
    arrows: true,
    slidesToShow: 1,
    slidesToScroll: 1,
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yevgeniy Kisselyov, 2016-12-22
@grishaaa

Possible:
1. Enable autoplay in "slider code"

.....
autoplay: true,
.....

2. Add autoplay stop after slide change:
$('.slider').on('afterChange', function(event, slick, direction){
    $('.slider').slick('slickPause');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question