页面加载时,计时器启动,但每次发生触摸事件时都会重置。然而,当我滚动浏览我的<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/