Skip to content

stoyanovk/MagneticHover

Repository files navigation

MagneticHover

magneticHover lets you trigger hover effect on the element when the cursor is near it, but not over it yet.

creation of adam picture. hands crop
Usage

import MagneticHover from "magnetic-hover"

const htmlElement= document.getElementById('element')

function showDistance(distance){
  console.log(distance)
}
new MagneticHover({
  element:htmlElement
  radius:100,
  callback:showDistance
})

Settings:
element - HTML element radius - distance to element, where will work mousemove event callback - function

Example: some link to example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published