GithubHelp home page GithubHelp logo

yeluojun / touchrobot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coldday/touchrobot

0.0 1.0 0.0 5.33 MB

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

Home Page: https://coldday.github.io/touchRobot/test.html

JavaScript 77.43% HTML 22.57%

touchrobot's Introduction

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

demo

操作步骤

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

demo

操作步骤

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

touchrobot's People

Contributors

coldday avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.