Wondering what’s next for npm?Check out our public roadmap! »

    element-resize-event
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/element-resize-event package

    3.0.6 • Public • Published

    element-resize-event

    Library to make it easy to listen for element resize events

    Code borrowed from a blog post by backalleycoder.com.

    Install

    npm install element-resize-event

    Dependencies

    This library depends on the availability of requestAnimationFrame and cancelAnimationFrame

    Usage

    var elementResizeEvent = require("element-resize-event")
    
    var element = document.getElementById("resize")
    
    elementResizeEvent(element, function () {
      console.log("resized!")
      console.log(element.offsetWidth)
    })

    Unbinding The Event Listener

    var unbind = require("element-resize-event").unbind
    
    unbind(element)

    Install

    npm i element-resize-event

    DownloadsWeekly Downloads

    54,432

    Version

    3.0.6

    License

    MIT

    Unpacked Size

    14.7 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar
    • avatar