2013-01-19 1 views

답변

3

불행하게도 swipeup 및 swipedown jQuery를 모바일에 존재하지 않는 가상 마우스 오버를하는 vmouseover가, 그리고 그들이 버전 1.3에 대한 계획이었습니다되지 않습니다 생각합니다. 타사 플러그인이 여기에 있습니다 : http://developingwithstyle.blogspot.com/2010/11/jquery-mobile-swipe-up-down-left-right.html. 일반 이벤트처럼 사용하십시오 : swipeedownswipeup.

이 구현이 필요한 경우이 플러그인을 사용할 수도 있습니다 : http://www.netcu.de/jquery-touchwipe-iphone-ipad-library. Android 기기에서도 작동합니다. 이것은 공식적인 이벤트와 달리 데스크톱 브라우저에서 작동하지 않기 때문에 최악의 시나리오 솔루션입니다. 여기

는 모바일 장치에서 테스트, 작업 예제하십시오 pageshow 처리기에 다음 코드를 추가하여 http://jsfiddle.net/Gajotres/WYnnk/

$("#wrapper").touchwipe({ 
     wipeLeft: function() { 
      $("#carousel").trigger("next", 1); 
     }, 
     wipeRight: function() { 
      $("#carousel").trigger("next", 1);   
     }, 
     min_move_x: 20, 
     min_move_y: 20, 
     preventDefaultEvents: true 
    }); 
1

, 나는의 헤더에 기능을 갱신하기 위해 풀을 시뮬레이션 할 수 있었다 내 페이지 ...

// Set aside the thresholds so they can be reset later. 
    var _scrollSupressionThreshold = $.event.special.swipe.scrollSupressionThreshold; 
    var _horizontalDistanceThreshold = $.event.special.swipe.horizontalDistanceThreshold; 
    var _verticalDistanceThreshold = $.event.special.swipe.verticalDistanceThreshold; 

    // Adjust the thresholds for a vertical swipe. 
    $.event.special.swipe.scrollSupressionThreshold = 5; 
    $.event.special.swipe.horizontalDistanceThreshold = 1; 
    $.event.special.swipe.verticalDistanceThreshold = 128; 

    // Listen for the swipe event... 
    $('#my_jqm_page div[data-role="header"]').on("swipe", function() { 

    // Reset thresholds. 
    $.event.special.swipe.scrollSupressionThreshold = _scrollSupressionThreshold; 
    $.event.special.swipe.horizontalDistanceThreshold = _horizontalDistanceThreshold; 
    $.event.special.swipe.verticalDistanceThreshold = _verticalDistanceThreshold; 

    // Take action... 
    console.log('Vertical swipe!'); 

    }); 
관련 문제