utilizes.area
TypeScript icon, indicating that this package has built-in type declarations

1.2.9 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i utilizes.area

Weekly Downloads

4

Version

1.2.9

License

MIT

Unpacked Size

54.4 kB

Total Files

5

Last publish

Collaborators

  • natqe3