Small utility that:
- appends an element to
document.body
or to a container element; - sets the transform property of the element based on
mousemove
event; - adds, removes, changes data-attributes of the element based on
mouseover
/mouseout
event;
Useful to create and animate an element that follow mouse movement.
container: container element, default to
document.body`;elementClass
: class to assign to the cursor elementinnerElementClass
: class to assign to the inner cursor elementdefaultType
: default cursor typeinnerMarkup
: custom markup of the inner element (makesinnerElementClass
useless)