hover-js
v1.0.4
Published
Library to add class to elements when user mouse is over another element.
Downloads
8
Readme
hover-js
Library to add class to elements when user mouse is over another element.
Usage
Load as ES6 module
Load module
import hoverPlugin from 'hover-js';
Load as script
Load the script file.
Then do the following:
var hoverPlugin = hover_js.default;
Usage
You can start it
hoverPlugin.start()
also if you want to stop it, you can use hovePlugin.stop()
use data-hover
and data-hover-target
attributes on Your HTML to apply the class that is under data-hover
to the elements that satisfied selector specified on data-hover-target
.
Example
https://codepen.io/soyto/pen/qgPLrr