javascript 有没有办法在单击导航滑块时禁用自动滚动的光滑滑块?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30013101/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a way to disable slick slider from autoscrolling when clicked on navigation slider?
提问by Xeen
There's the slider syncing
functionality that I need to use (can be seen here http://kenwheeler.github.io/slick/when you scroll down a bit), but, as we can see, when you click on the navigation slide, the whole navigation autoslides further, I'd like to disable this functionality so that the main slide changes, but the navigation stays at the same level as it is until I click next
or previous
arrow.
有slider syncing
我需要使用的功能(可以在这里看到http://kenwheeler.github.io/slick/当你向下滚动一点时),但是,正如我们所看到的,当你点击导航幻灯片时,整个导航自动滑动进一步,我想禁用此功能,以便主幻灯片更改,但导航保持在同一级别,直到我单击next
或previous
箭头。
Is there a setting for that or do I have to change the core to achieve this?
是否有设置或我是否必须更改核心才能实现此目的?
jsfiddlehttp://jsfiddle.net/9kp36e09/- so now if you click on navigation, it scrolls, I want to disable that scrolling.
jsfiddle http://jsfiddle.net/9kp36e09/- 所以现在如果你点击导航,它会滚动,我想禁用滚动。
回答by shrekuu
Well, it is not in the documentation, but I fixed it by add the accessibility
to false
. e.g:
好吧,它不在文档中,但我通过添加accessibility
到false
. 例如:
$('#sliders').slick({
accessibility: false
});