javascript - Slick edge event not triggering - Stack Overflow

I have this is script;var $carousel = $("[data-carousel]");$carousel.on('edge', fun

I have this is script;

var $carousel = $("[data-carousel]");

$carousel.on('edge', function(event, slick, direction){
  console.log("edge");
});

$carousel.slick({
  slidesToShow: 4,
  slidesToScroll: 4,
  accessibility: false,
  draggable: false,
  infinite: false,
  prevArrow: $("[data-carousel-prev]"),
  nextArrow: $("[data-carousel-next]"),
  responsive: [
    {
      breakpoint: 1370,
      settings: {
        slidesToShow: 3,
        slidesToScroll: 3
      }
    }
  ]
});

But when reaching the edge, it does not trigger any edge event following the docs seems ok I'm using slick 1.5.6

I have this is script;

var $carousel = $("[data-carousel]");

$carousel.on('edge', function(event, slick, direction){
  console.log("edge");
});

$carousel.slick({
  slidesToShow: 4,
  slidesToScroll: 4,
  accessibility: false,
  draggable: false,
  infinite: false,
  prevArrow: $("[data-carousel-prev]"),
  nextArrow: $("[data-carousel-next]"),
  responsive: [
    {
      breakpoint: 1370,
      settings: {
        slidesToShow: 3,
        slidesToScroll: 3
      }
    }
  ]
});

But when reaching the edge, it does not trigger any edge event following the docs seems ok I'm using slick 1.5.6

Share Improve this question asked Jul 15, 2015 at 13:49 Alessandro DiasAlessandro Dias 771 silver badge9 bronze badges 1
  • Same here. Can you find the problem? – Vahid Commented Sep 4, 2015 at 15:33
Add a ment  | 

1 Answer 1

Reset to default 5

The edge event only fires when overscrolling happens.

Such overscrolling can only happen if draggable is set to true and you drag over the last slide.

Using the buttons will not trigger the edge event.

If you are looking to execute some code if the "next" button is triggered at the last slide, use the indexes in bination with the afterChange event.

Disclaimer: used version in this answer: 1.5.9

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745403101a4626190.html

相关推荐

  • javascript - Slick edge event not triggering - Stack Overflow

    I have this is script;var $carousel = $("[data-carousel]");$carousel.on('edge', fun

    6小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信