jQuery UI의 정렬 가능한 함수를 사용하여 항목을 가로로 정렬 할 수있는 비교 사이트를 개발 중입니다. 모든 항목은 가로 또는 세로로 스크롤 할 수있는 컨테이너 내에 있습니다. 데스크톱에서는 정상적으로 작동하며 태블릿에서도 작동하도록 노력하고 있습니다.jQuery UI sortable touch duration
난 이미 따라 정제에 정렬 기능 작업을 할 수 있습니다 : jsFiddle
document.addEventListener("touchstart", module.bindTouchHandler, true);
document.addEventListener("touchmove", module.bindTouchHandler, true);
document.addEventListener("touchend", module.bindTouchHandler, true);
document.addEventListener("touchcancel", module.bindTouchHandler, true);
module.bindTouchHandler = function(event){
var touch = event.changedTouches[0];
var simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent({
touchstart: "mousedown",
touchmove: "mousemove",
touchend: "mouseup"
}[event.type], true, true, window, 1,
touch.screenX, touch.screenY,
touch.clientX, touch.clientY, false,
false, false, false, 0, null);
touch.target.dispatchEvent(simulatedEvent);
event.preventDefault();
}
문제는 다른 터치 이벤트 가로/세로로 스크롤 이제 가능성을 방지한다는 것입니다. 나는 이것을 지연시키고 싶다. 사용자가 2 초 동안 터치하는 경우에만 요소 정렬/끌기를 시작합니다.
어떻게 처리 할 수 있습니까?
혹시 이것에 대한 해결책을 개발 한 적이 있습니까? – noitse