jQuery -- touch事件 touchend失效解决方案
来源:互联网 发布:linux fifo 编辑:程序博客网 时间:2024/06/03 20:42
在使用touch事件是会出现touchstart后touchend不执行的问题这时候只需要加一行代码即可:
$("body").on("touchstart", function(e) { e.preventDefault(); });
但是有人在谷歌浏览器或许会发现报错,这时候换成下面这行代码就可以解决:
$("body").on("touchstart", function(e) { // 判断默认行为是否可以被禁用 if (e.cancelable) { // 判断默认行为是否已经被禁用 if (!e.defaultPrevented) { e.preventDefault(); } } });
阅读全文
0 0
- jQuery -- touch事件 touchend失效解决方案
- jQuery -- touch事件详解(touchstart、touchmove和touchend)
- 移动互联网终端的touch事件,touchstart, touchend, touchmove
- 移动互联网终端的touch事件,touchstart, touchend, touchmove
- 互联网终端的touch事件,touchstart, touchend, touchmove
- 移动互联网终端的touch事件,touchstart, touchend, touchmove
- 移动互联网终端的touch事件,touchstart, touchend, touchmove
- 移动web相关touch事件触发(touchstart/touchmove/touchend)
- 移动互联网终端的touch事件,touchstart, touchend, touchmove
- Sencha Touch 给 Panel 注册点击事件(tap)和其他touchstart,touchend 等事件
- Jquery绑定事件失效
- html 移动互联网终端的javascript touch事件,touchstart, touchend, touchmove
- html 移动互联网终端的javascript touch事件,touchstart, touchend, touchmove
- html 移动互联网终端的javascript touch事件,touchstart, touchend, touchmove
- [Phonegap+Sencha Touch] 移动开发25 关于sencha touch在华为、红米、HTC等部分手机下hide事件失效,msgbox无法关闭的解决方案
- [Phonegap+Sencha Touch] 移动开发25 关于sencha touch在华为、红米、HTC等部分手机下hide事件失效,msgbox无法关闭的解决方案
- jquery的click事件失效
- [置顶]关于sencha touch在华为、红米等部分手机下hide事件失效,msgbox无法关闭的解决方案(已更新最新解决方案)
- Scala练习-归并排序
- 单链表全集简化
- 天生丽质小仙女java实训笔记基础00
- poj3254(状态压缩DP)
- c3p0配置
- jQuery -- touch事件 touchend失效解决方案
- 接口内部的类
- 数据库主从同步复制原理
- JavaBean
- YII2.0电商平台开发笔记-2
- (转)鼎晖投资总裁焦震:别把投资高雅化,就是个做买卖的
- Java Static关键字详解
- 操作系统之线程的基础知识
- Object 类