您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在jQuery mobile中,tap和vclick之间有什么区别?

在jQuery mobile中,tap和vclick之间有什么区别?

在使用jQuery Mobile Tap的情况下,它只能在移动设备上使用。情况不再如此。

创建VClick的目的是弥合台式机/移动设备之间的点击/点击不兼容之间的差距。

现在,您可以自由使用水龙头了,但是问题很少。在iOS平台上点击将失败。应该改用Touchstart。

例子:

在台式机和移动设备上均可使用。

桌面Firefox 19和Chrome 25.0.1364.152-delay

$(document).on(‘pagebeforeshow’, ‘#index’, function(){ $( document ).on( “vclick”, ‘[data-role=”page”]’, function() { $( this ).append( “vmouseup fired.” ); }); });

点按:

它过去只能在移动设备上运行,现在也可以在台式机浏览器上运行,但是在带有jQuery Mobile 1.1及更低版本的iOS上将失败。

桌面Firefox 19和Chrome 25.0.1364.152-delay

$(document).on(‘pagebeforeshow’, ‘#index’, function(){ $( document ).on( “tap”, ‘[data-role=”page”]’, function() { $( this ).append( “tap fired.” ); }); });

将在移动设备和桌面浏览器上工作。

桌面Firefox 19和Chrome 25.0.1364.152-

$(document).on(‘pagebeforeshow’, ‘#index’, function(){ $( document ).on( “click”, ‘[data-role=”page”]’, function() { $( this ).append( “click fired.” ); }); });

如果您想使用VClick向后兼容 ,则在其他情况下请使用 。

JS 2022/1/1 18:18:14 有296人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶