jQuery UI Draggable在iOS设备上不起作用

编程入门 行业动态 更新时间:2024-10-28 14:32:21
本文介绍了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?

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

The test site I'm running it on is www.pudle.co.uk/mov/draggable.html and I've also made a jsfiddle - jsfiddle/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.

看看这个: github/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设备上不起作用

本文发布于:2023-11-27 05:47:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636839.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上不   设备   UI   jQuery   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!