jQuery Mobile swipeleft 事件

jQuery Mobile 事件 jQuery Mobile 事件

实例

水平方向向左滑动 <p> 元素并隐藏它:

$("p").on("swipeleft",function(){
  $(this).hide();
});

尝试一下 »

定义和用法

swipeleft 事件是指在一秒内水平向左拖拽大于30px(垂直方向拖拽小于75px)时触发。

相关事件:

  • swipe - 指在一秒内,水平方向拖拽大于30px或垂直方向拖拽小于75px时触发的事件。
  • swiperight - 指在一秒内,水平方向向右拖拽大于30px时触发的事件。

语法

$("selector").on("swipeleft",function(event){...})

参数描述
function(event)必须。指定 swipeleft 事件触发时执行的函数。

该函数有可选的事件对象 ,事件对象可以是任何 jQuery 事件属性 (例如 event.target, event.type, 等)。更多信息请查阅 jQuery 事件参考手册


实例

更多实例

事件对象
使用 event.target 属性返回swipeleft事件触发的DOM元素。


jQuery Mobile 事件 jQuery Mobile 事件

0 个评论

要回复文章请先登录注册