jQuery Mobile Touch 事件
Touch 事件在用戶觸摸屏幕(頁面)時(shí)觸發(fā)。
提示:Touch 事件同樣適用于桌面電腦:點(diǎn)擊鼠標(biāo)!
jQuery Mobile Tap
tap 事件在用戶敲擊某個(gè)元素時(shí)觸發(fā)。
下面的例子當(dāng) <p> 元素上觸發(fā) tap 事件時(shí),隱藏當(dāng)前 <p> 元素:
實(shí)例
$("p").on("tap",function(){
$(this).hide();
});
jQuery Mobile Taphold
taphold 事件在用戶敲擊某個(gè)元素并保持一秒時(shí)被觸發(fā):
實(shí)例
$("p").on("taphold",function(){
$(this).hide();
});
jQuery Mobile Swipe
swipe 事件在用戶在某個(gè)元素上水平滑動(dòng)超過 30px 時(shí)被觸發(fā):
實(shí)例
$("p").on("swipe",function(){
$("span").text("Swipe detected!");
});
jQuery Mobile Swipeleft
swipeleft 事件在用戶在某個(gè)元素上從左滑動(dòng)超過 30px 時(shí)被觸發(fā):
實(shí)例
$("p").on("swipeleft",function(){
alert("You swiped left!");
});
jQuery Mobile Swiperight
swiperight 事件在用戶在某個(gè)元素上從右滑動(dòng)超過 30px 時(shí)被觸發(fā):
實(shí)例
$("p").on("swiperight",function(){
alert("You swiped right!");
});