4

私はjquerymobileのドキュメントを見て、次のことを確認しましswipeswipeleftswiperight

スワイプバーティカルイベントなどはあり ますか?

4

3 に答える 3

3

残念ながら、スワイプアップとスワイプダウンはjQuery mobileには存在せず、バージョン1.3では計画されていません。ここにサードパーティのプラグインがあります:http://developingwithstyle.blogspot.com/2010/11/jquery-mobile-swipe-up-down-left-right.html。通常のイベントを使用するのと同じように使用します:スワイプダウンスワイプアップ

この実装が必要な場合は、このプラグインを使用することもできます: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
    }); 
于 2013-01-19T19:30:06.387 に答える
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!');

  });
于 2015-08-11T16:35:47.837 に答える
0

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

仮想マウスオーバーであるvmouseoverがあると思います

于 2013-01-19T19:16:46.137 に答える