为什么我的 YUI 滑块上的触摸事件突然停止工作?
我有一个使用 YUI 3 slider 的网站,该网站多年来一直运行良好。大约两周前,我在手机上向朋友展示了我的网站,效果非常好。
然后,大约一周前,我再次使用我的手机向另一位朋友展示它,滑块上的拇指无法移动。有些事情发生了变化,他们不再响应我手机上的触摸事件。
在计算机上,使用鼠标时,拇指是可拖动的。一切都很完美。
仅在界面需要触摸的设备上我无法移动拇指。我在两台 Android 设备、一台 iPhone 和一台 iPad 上进行了测试。
javascript 在呈现滑块时加载。我可以单击滑块的导轨,拇指会跳到该位置,因此触摸事件并不完全消失。
然而,据我所知,在带有触摸屏的移动设备上用拇指触摸并拖动是不可能的。
我已经尝试了一个星期来弄清楚我可能改变了什么,但我就是无法解决它。
有人可以查看此页面并告诉我为什么触摸事件不起作用吗?
请注意,我尝试将此版本简化为仅提供演示问题所需的最低限度,但这里或那里可能存在一些奇怪的不相关代码片段。
任何建议将不胜感激。感谢您的时间和帮助。
请注意:此问题中链接的示例页面很可能在一段时间后被删除。感谢您的理解。
I had a site using YUI 3 sliders that was working fine for ages. About two weeks ago I was showing a friend my site on my phone, and it worked great.
Then, about a week ago, I was showing it to another friend using my phone again, and the thumbs on the slider would not move. Something has changed and they no longer respond to touch events on my phone.
On a computer, when using a mouse, the thumb is draggable. Everything works perfectly.
It's only on devices where the interface requires touch that I can't move the thumbs. I've tested on two Android devices, an iPhone, and an iPad.
The javascript loads, as it renders the slider. I can click on the rail of the slider and the thumb jumps to that position, so it's not like touch events are completely gone.
However, as far as I can tell, it is not possible to touch the thumb and drag it on a mobile device with a touch screen.
I have tried for a week to figure out what I might have changed, but I just can't solve it.
Can someone look at this page and tell me why touch events aren't working?
Note that I've tried to make this a version that is stripped down to provide only the minimum required to demonstrate the problem, but there might be some odd snippets of irrelevant code here or there.
Any advice would be much appreciated. Thank you for your time and assistance.
Please note: The example page linked to in this question will very likely be removed after a period of time. Thanks for your understanding.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎您需要指定
use("slider"
而不是use("*"
。这是一个工作(并且大大简化)的演示。It seems like you need to specify
use("slider"
instead ofuse("*"
. Here's a working (and greatly simplified) demo.