简体   繁体   English

jQuery Touchpunch可拖动滞后在Android设备上

[英]JQuery touchpunch draggable laggy on android device

I have used the draggable jquery of touchpunch: http://touchpunch.furf.com/ in my phonegap application for my android phone. 我在Android手机的phonegap应用程序中使用了touchpunch的可拖动jquery: http ://touchpunch.furf.com/。 I uploaded pictures of objects to drag over a picture. 我上传了对象的图片以将其拖到图片上。 But whatever object I try to drag it always seems laggy, while on my iphone it works perfectly fine without lag. 但是,无论我尝试拖动什么物体,它总是显得迟钝,而在我的iPhone上,它却可以完美运行而不会出现滞后。 This has been tested on a Desire HD and Samsung Galaxy S2 so not the slowest types of android phones. 这已经在Desire HD和Samsung Galaxy S2上进行了测试,因此不是最慢类型的android手机。 Does anyone have an idea what is causing it and how to fix it? 有谁知道导致它的原因以及如何解决它? Thanks! 谢谢!

Have you set position : absolute for the element? 您是否已设置position : absolute元素的position : absolute This can increase performance greatly because anything with position : relative being animated/moved requires a redraw of the whole page (since ancestors and descendants can be affected by any changes). 这可以大大提高性能,因为任何具有position : relative动画/移动的position : relative都需要重新绘制整个页面(因为祖先和后代可能会受到任何更改的影响)。 Using position : absolute only requires a redraw of the region that the element takes-up (so anything in-front or behind the element and the element itself). 使用position : absolute仅需要重绘元素占用的区域(因此,在元素之前或之后的任何东西以及元素本身)。

I tested the demo page on my Droid X (almost two years old now) and it functioned fine, but it is a simple test. 我在Droid X上测试了演示页(现在已经快两年了),它的功能还不错,但这是一个简单的测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM