打印touch事件,打印手机触摸事件
2012-06-26 09:35
225 查看
function printEvent(evt) { try { var tmp = ''; for(var i in evt) { tmp += i+':' var v = evt[i]+''; if(v=='[object HTMLDivElement]') { tmp+=' <b>div</b> - '+evt[i].id+'<br/>'; } else if(''+(evt[i])=='[object TouchList]') { tmp+=' <br/> <b>touchlist</b>:<div style="border:1px solid red; margin:1px"> '; for(var x in evt[i]) { if(''+(evt[i][x])=='[object Touch]') { tmp+='<br> ----'+x+':'+' <b>Touch</b><br/><div style="border:1px solid blue;margin:1px">'; for(var y in evt[i][x]) { if(evt[i][x][y]=='[object HTMLDivElement]') { tmp+=' ----'+y+':<b>div</b> - '+evt[i][x][y].id+'<br/>'; }else tmp+='<br> ----'+y+':'+evt[i][x][y]+'<br/>'; } tmp+='</div>'; }else tmp+='<br> '+x+':'+evt[i][x]+'<br/>'; } tmp+='</div>'; }else if(typeof(evt[i])=='number'){ tmp+='<font color="green">'+v+'</font><br/>'; } else tmp+=''+v+'<br/>'; } return tmp; }catch(e){ alert(e) } }
相关文章推荐
- 打印touch事件,打印手机触摸事件
- JS事件监听手机屏幕触摸事件 Touch
- 用touchStart事件代替click处理手机页面上的触摸事件
- Vue.js移动端左滑demo和JS事件监听手机屏幕触摸事件 Touch
- JS事件监听手机屏幕触摸事件 Touch
- 用touchStart事件代替click处理手机页面上的触摸事件
- 手机页面touch触摸事件
- JS事件监听手机屏幕触摸事件 Touch
- [置顶] touch事件(监听手机屏幕触摸事件)
- Android触摸事件分发机制之requestDisallowInterceptTouchEvent
- UIView中触摸事件touchBegin
- IOS中触摸事件(touch event)的分发以及响应者链(The Responder Chain)机制理解
- js 触摸事件 touch
- HTML5实战与剖析之触摸事件(touchstart、touchmove和touchend)
- h5触摸事件:touchstart、touchmove和touchend
- cocos2d JS touch(触摸监听)-快速添加事件监听器到管理器
- html5移动端触摸事件touch
- Android触摸事件(一)-AbsTouchEventHandle
- [HTML5]移动端前端常见的触摸相关事件touch、tab、swipe等
- Android 判断触摸点是否在某个view的区域,解决子view与parent的touch事件冲突