jQuery Mobile 触控
Touch 事件在用户触摸屏幕(页面)时触发。
提示:Touch 事件同样适用于桌面电脑:点击鼠标!
jQuery Mobile Tap
tap 事件在用户敲击某个元素时触发。
下面的例子当 <p> 元素上触发 tap 事件时,隐藏当前 <p> 元素:
实例
- $("p").on("tap",function(){
- $(this).hide();
- });
jQuery Mobile Taphold
taphold 事件在用户敲击某个元素并保持一秒时被触发:
实例
- $("p").on("taphold",function(){
- $(this).hide();
- });
jQuery Mobile Swipe
swipe 事件在用户在某个元素上水平滑动超过 30px 时被触发:
实例
- $("p").on("swipe",function(){
- $("span").text("Swipe detected!");
- });
jQuery Mobile Swipeleft
swipeleft 事件在用户在某个元素上从左滑动超过 30px 时被触发:
实例
- $("p").on("swipeleft",function(){
- alert("You swiped left!");
- });
jQuery Mobile Swiperight
swiperight 事件在用户在某个元素上从右滑动超过 30px 时被触发:
实例
- $("p").on("swiperight",function(){
- alert("You swiped right!");
- });
转载本站内容时,请务必注明来自W3xue,违者必究。