admin管理员组文章数量:1424948
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
1 Answer
Reset to default 5The 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
本文标签: javascriptSlick edge event not triggeringStack Overflow
版权声明:本文标题:javascript - Slick edge event not triggering - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745403100a2657126.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论