hide-mouse

2.0.2 • Public • Published

hide-mouse

Hides the mouse cursor after a specific time.

Install

npm install hide-mouse

Usage

To hide the cursor pass the desired DOM-element as el property and define the timeout as the hideAfter property in ms.

import hideMouse from 'hide-mouse';
 
const el = document.getElementById('hide-area');
const hm = hideMouse({ el, hideAfter: 2000 });

It is also possible to temporarily deactiave the behavior by using the deactivate method.

hm.deactivate();
// ...
hm.activate();

To completely unsubscribe and turn off the service use the kill method.

hm.kill();

Example

To start the example run npm run example and visit http://localhost:1234

Build

To generate a new build run npm run build, which will fail if tests won't pass. You can manually run the tests by using npm test.

Readme

Keywords

Package Sidebar

Install

npm i hide-mouse

Weekly Downloads

3

Version

2.0.2

License

GNU GENERAL PUBLIC LICENSE

Unpacked Size

307 kB

Total Files

5

Last publish

Collaborators

  • matthiasklan