Skip to content

jquery-elementresize is a simple jQuery plugin for detecting ALL changes to the size of ANY positioned element

License

Notifications You must be signed in to change notification settings

rbtbar/jquery-elementresize

Repository files navigation

jQuery Element Resize Plugin

A jQuery plugin that adds cross-browser element resize support.

In order to use the plugin, simply bind the elementResize event to a positioned element.

It also provides two helper methods called elementResize and unelementResize that act just like other event helper methods in jQuery.

// using on
$('#my_elem').on('elementResize', function(event) {
    var elem = $(this),
        width = elem.width(), 
        height = elem.height();
    console.log(width, height);
});

// using the event helper
$('#my_elem').elementResize(function(event) {
   var elem = $(this),
        width = elem.width(), 
        height = elem.height();
    console.log(width, height);
});

Support for UMD modules

Support for AMD, Node/CommonJS, Browser globals is baked in.

About

jquery-elementresize is a simple jQuery plugin for detecting ALL changes to the size of ANY positioned element

Resources

License

Stars

Watchers

Forks

Packages