2013-01-19 38 views

回答

3

不幸的是swipeup和swipedown在jQuery Mobile的不存在,他們沒有刨了1.3版本。這裏有第三方插件:http://developingwithstyle.blogspot.com/2010/11/jquery-mobile-swipe-up-down-left-right.html。像使用正常事件一樣使用它們:swipedownswipeup

如果您需要此實施,您還可以使用此插件:http://www.netcu.de/jquery-touchwipe-iphone-ipad-library。它也適用於Android設備。這是一種最糟糕的情況解決方案,因爲與官方活動不同,那些桌面瀏覽器無法使用。

下面是一個工作示例,測試它唯一的移動設備: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 
    }); 
0

http://jquerymobile.com/test/docs/api/events.html

我認爲有vmouseover,這是一個虛擬的鼠標懸停

+0

是不是你在垂直和虛擬之間混淆? –

+0

不,這是一個虛擬的垂直鼠標,我想 - 都!這是我的理解 –

+0

這是一個很好的問題...... –

1

通過添加以下代碼到pageshow處理,我是能夠模擬拉刷新的頭功能我的頁面...

// 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!'); 

    }); 
相關問題