<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>touchmove</title>
<style>
#tm{
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 30px;
background-color: blue;
text-align: center;
line-height: 30px;
color: white;
}
</style>
</head>
<body> <div id="tm">touchmove</div> <script>
var obj = document.getElementById('tm');
obj.addEventListener('touchstart', function(event){
obj.style.backgroundColor = 'red';
});
obj.addEventListener('touchend', function(event){
obj.style.backgroundColor = 'blue';
obj.innerHTML = 'touchmove';
});
obj.addEventListener('touchmove', function(event) {
event.preventDefault();
var touch = event.targetTouches[0];
obj.style.left = touch.pageX-50 + 'px';
obj.style.top = touch.pageY-50 + 'px'; obj.innerHTML = 'x:' + touch.pageX + ', y:' + touch.pageY;
}, false);
</script> </body>
</html>

最新文章

  1. 集成Visual Studio/MSBuild的开发/发布流程和 FIS3
  2. 快速幂 fast_exp
  3. [Spice-devel] usbredir for Windows Client
  4. MFC的消息映射机制揭秘
  5. MVC常见的控制器,接口,数据层之间的操作
  6. JSON lib 里JsonConfig详解
  7. vim操作命令
  8. deeplearning.ai 神经网络和深度学习 week4 深层神经网络 听课笔记
  9. Docker 服务
  10. 实战ELK(6)使用logstash同步mysql数据到ElasticSearch
  11. matlab做曲线拟合
  12. Spring boot jpa @Column命名大小写问题
  13. XtrasReport 标签打印
  14. SpringCloud学习(6)——Hystrix熔断器
  15. Oracle Spatial GIS相关研究
  16. Ubuntu16.04安装Zabbix
  17. &quot;静态方法里仅仅能调用静态变量和静态方法&quot;具体解释
  18. Django day17 博客项目(一)
  19. 那么再会吧!OI!(HNOI2019退役记)
  20. nyoj--744--蚂蚁的难题(一)

热门文章

  1. sql数据库之多库查询
  2. SpringBoot @Value读取properties文件的属性
  3. eclipse中没有tomcat小猫
  4. NumPy 矩阵库(Matrix)
  5. java 测试开发基础知识(类加载,JVM等)
  6. 在.NET 4中用IIS部署WCF就这么简单
  7. 179. Largest Number(INT, String)
  8. 文本工具 TextUtils 字符串
  9. TZOJ 1937 Hie with the Pie(floyd+状压dp)
  10. pa sslvpn使用手册