outy

0.1.2 • Public • Published

Outy

npm version

A simple way to listen for events outside of elements. Inspired by outside-click.

Install

yarn add outy

npm install outy --save

<script src="https://unpkg.com/outy/index.js"></script>
(UMD library exposed as `outy`)

Usage

const overlay = document.getElementById('#overlay')
const outsideTap = outy(overlay, ['click', 'touchend'], handleOutsideTap)
 
function handleOutsideTap() {
  // maybe close an overlay?
}
 
// cleanup later
outsideTap.remove()

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    1,133
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    1,133
  • 0.1.1
    1
  • 0.1.0
    1
  • 0.0.1
    4

Package Sidebar

Install

npm i outy

Weekly Downloads

1,139

Version

0.1.2

License

MIT

Last publish

Collaborators

  • souporserious