스 와이프 이벤트 및 요소를 드래그하는 데 문제가 있습니다.요소를 끌 때 swipeleft/-right를 깨기
내 응용 프로그램에서는 swipeleft/-right를 사용하여 페이지 간을 이동합니다 (작동합니다). 한 페이지에는 많은 드래그 요소 (드래그 작업)가 있습니다.
그래서 요소가 가로로 오른쪽으로 끌면 문제가됩니다. 스 와이프 레프트는 드래그 스톱 후에 작동합니다. 왼쪽으로 드래그하는 것, swiperight가 작동하는 것과 같습니다.
나를 혼란스럽게합니다.
요소를 드래그 할 때 스 와이프 레프트를 멈추거나 끊을 수 있습니까?
이
는 (유래 들으에서) 슬쩍에 대한 코드$('div.ui-page').live("swipeleft", function() {
var nextpage = $(this).next('div[data-role="page"]');
// swipe using id of next page if exists
if (nextpage.length > 0) {
$.mobile.changePage(nextpage, 'slide');
}
});
$('div.ui-page').live("swiperight", function() {
var prevpage = $(this).prev('div[data-role="page"]');
// swipe using id of next page if exists
if (prevpage.length > 0) {
$.mobile.changePage(prevpage, 'slide', true);
}
});
입니다 그리고 이것은 정확히 처리해야 드래그
$ (function(){
var numbers = [ 1, 2, 3, 4, 5 ];
numbers.sort(function() { return Math.random() - .5 });
alert(numbers);
for (var i=1; i<6; i++) {
$('#'+i).attr('src','bilder/'+numbers[i-1]+'.png').draggable({
cursor: 'move',
containment: $('#'+i).parent().parent(),
revert: true,
});
}
});
온/오프 끌기에 플래그를 설정 한 다음 anwer 위해 슬쩍 기능에 플래그에 대한 – ahren