utilizes.area
v1.2.9
Published
Return true if the given area is found on a given element, else false
Downloads
5
Readme
area
Return true if the given area is found on a given element, else false
Usage: area({ pageX: number, pageY: number }, of: HTMLElement): boolean
import { area } from 'utilizes.area'
const myButton = document.getElementById('my-button'))
window.addEventListener('click', ({ pageX, pageY }) => {
if (area({ pageX, pageY }, myButton)) {
alert(`you clicked on my button`)
}
})
This module exported from utilizes project.