zoukankan      html  css  js  c++  java
  • 打印touch事件,打印手机触摸事件

    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)
    	}
    }

  • 相关阅读:
    python-登录小游戏
    easyclick 学习
    PYQT5 学习
    Pycharm之QT配置
    标贴打印机的基本使用
    开发遇到的问题及其解决
    Datatable 数据源
    JIRA操作之JQL
    类视图函数 VIEW
    前端基础
  • 原文地址:https://www.cnblogs.com/lein317/p/5067628.html
Copyright © 2011-2022 走看看