jQuery UI Draggable在iOS设备上不起作用 [英] jQuery UI Draggable not working on ios devices

查看:167
本文介绍了jQuery UI Draggable在iOS设备上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.draggable(jQuery UI的一部分)来允许用户在简单的Web应用程序中来回移动项目.它在所有最新的OSX&桌面浏览器上都能正常运行. Windows(Windows Safari除外,在Windows Safari中,由于某种原因它仅垂直移动项目).

I am using .draggable (part of jQuery UI) to allow users to move items around as part of a simple web app. It works fine on all the latest desktop browsers for OSX & Windows (except Windows Safari, where it only moves the items vertically for some reason).

我遇到的主要问题是它无法在Safari IOS(该应用最初瞄准的地方)上运行.

The major problem Im having is it that it doesn't work on Safari IOS (which is where the app is originally targeted for).

是否存在兼容性原因,因此无法正常工作?

Is there a compatibility reason this isn't working?

还有另一种方法可以达到相同的效果吗?

Is there another way that the same effect could be achieved?

我正在其上运行的测试站点是 http://www.pudle. co.uk/mov/draggable.html ,我还制作了一个jsfiddle- http://jsfiddle. net/t9Ecz/.

The test site I'm running it on is http://www.pudle.co.uk/mov/draggable.html and I've also made a jsfiddle - http://jsfiddle.net/t9Ecz/.

任何人都非常感谢,欢呼.

Any helps much appreciated, cheers.

推荐答案

基于触摸的设备(如iPhone)缺少我们在台式机浏览器中习惯的所有与鼠标相关的常见事件.它确实包括: moousemove 鼠标移下鼠标移出等.

Touch-based devices like iPhone lacks all common mouse related events we are used to in desktop browsers. It does include: mousemove, mousedown, mouseup, among others.

因此,简短的答案是,您需要使用一种解决方案,该解决方案应针对上述鼠标事件"使用相应的触摸事件": touchstart touchmove 触摸结束触摸取消.

So, the short answer is, you will need to use a solution that have in mind "touch events" counterparts for those "mouse events" above: touchstart, touchmove, touchend or touchcancel.

看看这个: https://github.com/furf/jquery- ui-touch-punch

您可能也会对 jQuery mobile 感兴趣.

希望这是一个开始,您可以在其中找到满足您需求的合适解决方案.

Hope it´s a start where you can find a proper solution for your requirements.

这篇关于jQuery UI Draggable在iOS设备上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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