私はjquerymobileのドキュメントを見て、次のことを確認しましswipe
たswipeleft
。swiperight
スワイプバーティカルイベントなどはあり ますか?
私はjquerymobileのドキュメントを見て、次のことを確認しましswipe
たswipeleft
。swiperight
スワイプバーティカルイベントなどはあり ますか?
残念ながら、スワイプアップとスワイプダウンは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
});
次のコードをページショーハンドラーに追加することで、ページのヘッダーでプルして更新する機能をシミュレートすることができました...
// 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!');
});
http://jquerymobile.com/test/docs/api/events.html
仮想マウスオーバーであるvmouseoverがあると思います