touchils
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Touchils - H5 Touch Utils

NPM version

Aim to provide workaround event listeners for touch devices(such as 'long press' event), since some mobile browsers do not fully response to 'click' or 'contextmenu' events expectedly.

Events List

  • longPress

Pressing the touch screen and hold for spectific time(customizable). Event will not be triggered if the gesture moved or touchMove is fired during pressing.

  • more to be implemented... 🤣

Install

yarn add touchils

npm install touchils -S

Usage

(ES Module import only)

Add Event Listener

import { LongPress } from 'touchils';

const longPressEvt = new LongPress(document.getElementByID('test'), (e) => {
  alert('long press');
}));

Remove Event Listener

longPressEvt.remove();

Readme

Keywords

none

Package Sidebar

Install

npm i touchils

Weekly Downloads

9

Version

0.0.5

License

MIT

Unpacked Size

7.61 kB

Total Files

12

Last publish

Collaborators

  • kevinzhang2012