基本事件:
touchstart //手指刚接触屏幕时触发
touchmove //手指在屏幕上移动时触发
touchend //手指从屏幕上移开时触发
touchcancel //触摸过程被系统取消时触发(少用)
一、事件绑定(常用,重要)
touch.on( element, types, callback );
功能描述:事件绑定方法,根据参数区分事件绑定和事件代理。
小试牛刀
公共:
<style>
.d1 {
width: 100px;
height: 100px;
background-color: gold;
position: absolute;
}
</style>
</head>
<body>
<div class="d1"></div>
</body>
<script src="https://cdn.bootcss.com/touchjs/0.2.14/touch.min.js"></script>
1.左右滑动