启用了bxSlider触摸-禁用垂直触摸事件,因此仅水平触摸事件有效 [英] bxSlider touch enabled - disable vertical touch events so only horizontal touch events work

查看:155
本文介绍了启用了bxSlider触摸-禁用垂直触摸事件,因此仅水平触摸事件有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能正在使用我最喜欢的jquery滑块插件之一: bxSlider

I'm using probably one of my favourite jquery slider plugins: bxSlider

http://bxslider.com/options#touchEnabled

最近,他们对设备进行了一些触摸启用更新.这使您可以通过滑动来滚动滑块.

Recently they've updated with some touch enabling for devices. This allows you to scroll your sliders via swiping.

但是在我当前的项目中,我有一个幻灯片显示占据了整个网站的整个宽度,在设备上查看时,当我用手指向下滚动时,到达幻灯片显示时,我无法滚动在页面上向下滚动,而幻灯片显示则从左向右滚动.

But on my current project, I have a slideshow that takes up the entire width of my website, and when viewing on a device, as I scroll down with my finger, when I reach the the slideshow, I am unable to scroll down the page, and instead the slideshow scrolls left to right.

所以我的问题是,是否可以禁用垂直触摸事件,使其仅在水平滚动滚动条时起作用?

So my question is, is it possible to disable the vertical touch events so it only works when the scroll is swiped horizontally.

var winnerSlider = $('#slider').bxSlider({

});

如果有人可以帮助我,我会摆弄一个小提琴... http://jsfiddle.net/2Fcxw/10/

I have a fiddle if anyone can help... http://jsfiddle.net/2Fcxw/10/

扫描下面的qr以查看设备上的小提琴.

Scan qr below to view fiddle on device.

谢谢

推荐答案

$('#slider').bxSlider({
touchEnabled:false
});

这应该有效.

这篇关于启用了bxSlider触摸-禁用垂直触摸事件,因此仅水平触摸事件有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆