be-flashy
v0.0.2
Published
Set css class temporarily when element state changes
Readme
be-flashy (🚨)
Set css class temporarily when element state changes.
<data 🚨 value=12367.45>12,367.45</data>or
<data be-flashy value=12367.45>12,367.45</data>What this does:
- Watches for changes to the value attribute.
- When the value attribute changes, adds class 'be-flashy' for 1 second, removes it after 1 second.
Set the timeout
<data 🚨-duration=500 value=12367.45>12,367.45</data>Number is in milliseconds.
Observe some other attribute
<td aria-colindex=4 🚨-attr=aria-colindex></td>Observing changes to textContent
<output 🚨-attr=textContent>12,367.45</output>Viewing Locally
Any web server that serves static files with server-side includes will do but...
- Install git.
- Fork/clone this repo.
- Install node.
- Install Python 3 or later.
- Open command window to folder where you cloned this repo.
npm install
npm run serve
- Open http://localhost:8000/demo in a modern browser.
Running Tests
> npm run testUsing from ESM Module:
import 'be-flashy/be-flashy.js';Using from CDN:
<script type=module crossorigin=anonymous>
import 'https://esm.run/be-flashy';
</script>
