javascript - 滚动浏览 HTML <select> 列表时 iPad 未检测到触摸

标签 javascript jquery html ios ipad

页面加载时,计时器启动,但每次发生触摸事件时都会重置。然而,当我滚动浏览我的<select>时查看每个 <option> ,当我滑动向下滚动列表时,计时器不会重置。

idleTimer = null;
idleState = false;
idleWait = 10000;

$('*').bind('touchstart mousemove keydown onscroll scroll touchmove touchend touchcancel touchleave touch', function () {
    clearTimeout(idleTimer);
    if (idleState == true) {}
    idleState = false;
    idleTimer = setTimeout(function () { 
        location.reload();
    idleState = true; }, idleWait);
});

我也尝试过这些:

$('#the-list').bind(...)

$(document).bind(...)

<select>需要不同的触摸事件?由于它在 iPad 上运行,因此 native 操作系统是否有可能将列表包装在我不知道的内容中?

最佳答案

在谈论事件和样式时,有些元素根本超出了我们的能力范围。

select 元素就是其中之一。我认为 Apple 希望在整个平台上保持 select 元素的行为一致。

另一个例子是键盘。我们甚至还没有一个事件来监控键盘的可见性。

关于javascript - 滚动浏览 HTML <select> 列表时 iPad 未检测到触摸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23681466/

相关文章:

javascript - jQuery移动 ListView 更改选择元素并突出显示它

java - 在 Jsoup 中按内容选择标签并在给定标签后获取第 n 个标签

php - html5 &lt;input type ="file"accept ="image/*"capture ="camera"> display as image 而不是 "choose file"button

javascript - 如何使用javascript execCommand创建富文本编辑器?

javascript - JWPlayer - 禁止点击视频暂停/恢复?

javascript - 如何在 python django 中返回字典并在 javascript 中查看它?

javascript - jQuery:延迟显示下拉菜单内容

javascript - 如何使用 jQuery 和 IE7 检查附加的 <img/> src 属性是相对的还是绝对的?

javascript - 如何检查我的单选按钮是否在一个 div 中被选中?

javascript - 翻转所有卡片,但想一张一张地翻转