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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 11:30:03  来源:igfitidea点击:

Is there a way to disable slick slider from autoscrolling when clicked on navigation slider?

javascriptjqueryslider

提问by Xeen

There's the slider syncingfunctionality 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 nextor previousarrow.

slider syncing我需要使用的功能(可以在这里看到http://kenwheeler.github.io/slick/当你向下滚动一点时),但是,正如我们所看到的,当你点击导航幻灯片时,整个导航自动滑动进一步,我想禁用此功能,以便主幻灯片更改,但导航保持在同一级别,直到我单击nextprevious箭头。

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 accessibilityto false. e.g:

好吧,它不在文档中,但我通过添加accessibilityfalse. 例如:

$('#sliders').slick({
    accessibility: false
});