package
A simple way to listen for events outside of elements.
npm install outyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A simple way to listen for events outside of elements. Inspired by outside-click.
yarn add outy
npm install outy --save
<script src="https://unpkg.com/outy/index.js"></script>
(UMD library exposed as `outy`)const overlay = document.getElementById('#overlay')
const outsideTap = outy(overlay, ['click', 'touchend'], handleOutsideTap)
function handleOutsideTap() {
// maybe close an overlay?
}
// cleanup later
outsideTap.remove()