为什么我的 YUI 滑块上的触摸事件突然停止工作? [英] Why did touch events on my YUI slider suddenly stop working?

查看:32
本文介绍了为什么我的 YUI 滑块上的触摸事件突然停止工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 YUI 3 滑块 的网站,它运行了很长时间.大约两周前,我在手机上向一位朋友展示了我的网站,效果很好.

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.

只有在界面需要触摸的设备上,我才能移动拇指.我已经在两台 Android 设备、一部 iPhone 和一部 iPad 上进行了测试.

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.

javascript 加载,因为它呈现滑块.我可以点击滑块的导轨,拇指就会跳到那个位置,所以触摸事件并没有完全消失.

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.

推荐答案

看来你需要指定 use("slider" 而不是 use("*". 这是一个有效(并且大大简化)的演示.

It seems like you need to specify use("slider" instead of use("*". Here's a working (and greatly simplified) demo.

这篇关于为什么我的 YUI 滑块上的触摸事件突然停止工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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