js模拟手指触碰点击,手指滑动,下拉刷新

touchRobot

机器模拟移动端触碰点击,手指滑动

Install NPM

npm install touch-robot

import touchRobot from 'touch-robot'; CDN

<script type="text/javascript" src="./dist/touch-robot.min.js"></script> Usage

var robot = new touchRobot(dom); robot.touchLeft(); API

方法(method) 描述(description)
touchLeft 左滑
touchRight 右滑
touchTop 上滑
touchBottom 下滑
touchTo 定点滑动,参数startX,startY,endX,endY
touchClick 触碰点击
DEMO jQuery-slide滑块验证码

操作步骤

step1 将代码在控制台粘贴执行 step2 var robot = new touchRobot(document.querySelector('#btn')); robot.touchTo(0,0,400,0); swiper轮播

操作步骤

step1 将代码在控制台粘贴执行 step2 var robot = new touchRobot(document.querySelector('.swiper-container')) robot.touchLeft()

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。