javascript - Iscroll 导致滚动父项内的链接在触摸设备上变得不可点击

标签 javascript mobile iscroll

我正在尝试使用 iscroll 插件 ( https://github.com/cubiq/iscroll ) 为 div 添加滚动功能。我发现它使滚动父项内的链接不可单击。禁用该插件可以修复它。

起初我以为这与 -webkit-transform 有关,但事实似乎并非如此,因为我用它创建了一个独立的 fiddle 。

可以在此处找到演示 - http://jsfiddle.net/5Frv4/ 。使用移动 webkit 浏览器访问该问题以查看实际问题。

Iscroll 使用一些简单的选项进行初始化:

var menuScroll = new IScroll('#menu', {
    mouseWheel: true,
    scrollbars: 'custom',
    interactiveScrollbars: true,
});

我不确定我能做些什么来解决这个问题。有谁知道我还可以尝试什么吗?

最佳答案

您可以尝试 iScroll 的选项

click: true

To override the native scrolling iScroll has to inhibit some default browser behaviors, such as mouse clicks. If you want your application to respond to the click event you have to explicitly set this option to true. Please note that it is suggested to use the custom tap event instead (see below). http://iscrolljs.com/#configuring

关于javascript - Iscroll 导致滚动父项内的链接在触摸设备上变得不可点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23065200/

相关文章:

javascript - 如何正确地将 Angular Universal 网站部署到特定路径?

css - 尽管像素密度高,但为什么固定高度/宽度的 html 元素在移动设备上呈现的比预期的要大?

jquery - 如何在 iScroll 中拖动时不单击 href

javascript - 使用 express.router() 使用 api key 向第三方 API 发出获取请求;

javascript - 使用 lodash 或 underscorejs 查找字段的数组计数

css - 移动设备滚动得太远(进入空白区域)

QtQuick 2 - 侧面板示例

html - Iscroll 中的固定元素

android - 如何在没有 iScroll 的情况下在 PhoneGap 应用程序中使用下拉刷新功能?

javascript - 在页面中创建一个无限滚动的 div