Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victrme/clickdown
Speeds up your clicks by combining the speed of pointerdown, and the features of the click event
https://github.com/victrme/clickdown
accessibility dom event-listener javascript library npm
Last synced: about 2 months ago
JSON representation
Speeds up your clicks by combining the speed of pointerdown, and the features of the click event
- Host: GitHub
- URL: https://github.com/victrme/clickdown
- Owner: victrme
- License: mit
- Created: 2024-06-21T10:10:39.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-17T10:02:51.000Z (6 months ago)
- Last Synced: 2024-11-06T13:29:02.429Z (3 months ago)
- Topics: accessibility, dom, event-listener, javascript, library, npm
- Language: HTML
- Homepage: https://clickdown.pages.dev/
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clickdown
[npmjs](https://www.npmjs.com/package/clickdown) - [demo](https://clickdown.pages.dev/)
Speeds up clicks by combining the speed of pointerdown and the features of click in a single "clickdown" event.
It attaches the `onclickdown` function to Element and HTMLElement prototypes, which means you can use it with `getElementById`, `querySelector`, and others.
Like this:
```js
import 'clickdown'document.getElementById('my-input').onclickdown(function (event, target) {
console.log(event) // PointerEvent
console.log(target) //
})
```With options:
```js
import 'clickdown'const input = document.getElementById('my-input')
const listener = () => console.log('Hello world !')input.onclickdown(listener, {
propagate: false,
})
```