joe223 / resizing

Detect DOM resizing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resizing

DOM resizing detector, 1kb after minified.

Install

npm install resizing --save

Usage

import Resizing from 'resizing'

const r = new Resizing(dom: Element)

function detector(evt: ScrollEvent) {
    console.log('resizing!')
}

r.on(detector)
r.off(detector)
r.destroy()

Inspired by https://github.com/marcj/css-element-queries

About

Detect DOM resizing


Languages

Language:JavaScript 53.1%Language:HTML 46.9%