https://github.com/lecodeurdudimanche/js-html-picker
https://github.com/lecodeurdudimanche/js-html-picker
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lecodeurdudimanche/js-html-picker
- Owner: LeCodeurDuDimanche
- Created: 2020-09-05T16:51:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-06T12:04:03.000Z (almost 6 years ago)
- Last Synced: 2025-08-28T00:58:38.872Z (11 months ago)
- Language: HTML
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JS HTML picker
A Javascript library to let the user select HTML elements
## Usage
Call `enableSelection(container, onElementHover, onElementClick, options)` to enable user selection on the given container.
The optional `options` object may contain one or more of the following properties :
- `hoverStyle` : array with CSS attribute-value pairs to be applied when an element is hovered.
- `selectStyle` : array with CSS attribute-value pairs to be applied when an element is selected.
Hover and click callbacks are given the DOM element and the unique CSS selector of this element in the container as arguments.
Call `disableSelection(container)` to disable the selection.