jquery-ui sortable | 如何让它在iPad / touchdevices上工作?
如何获得在iPad和其他触摸平台上工作的jQuery-uisortingfunction? http://jqueryui.com/demos/sortable/
我试图与之合作
event.preventDefault(); event.cancelBubble=true; event.stopPropagation();
touchmove和滚动事件,但唯一的结果是 – 如预期的 – 页面不再滚动。
有任何想法吗? 谢谢! EH!
find一个解决scheme(只用iPad直到现在!)!
汤姆,我已经添加了以下代码到mouseProto._touchStart事件:
var time1Sec; var ifProceed = false, timerStart = false; mouseProto._touchStart = function (event) { var self = this; // Ignore the event if another widget is already being handled if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) { return; } if (!timerStart) { time1Sec = setTimeout(function () { ifProceed = true; }, 1000); timerStart=true; } if (ifProceed) { // Set the flag to prevent other widgets from inheriting the touch event touchHandled = true; // Track movement to determine if interaction was a click self._touchMoved = false; // Simulate the mouseover event simulateMouseEvent(event, 'mouseover'); // Simulate the mousemove event simulateMouseEvent(event, 'mousemove'); // Simulate the mousedown event simulateMouseEvent(event, 'mousedown'); ifProceed = false; timerStart=false; clearTimeout(time1Sec); } };