jquery.resizestart

0.1.1 • Public • Published

jQuery resizestart

A jQuery plugin that allows for window resize-start event handling.

Demo

See the demo here.

Usage

Include both the jQuery library and the resizestart plugin in your project:

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="js/jquery.resizestart.js"></script>

Execute the resizestart method to an element, instatiate options (if so desired), and run a callback functions:

$(window).resizestart({
    delay : 250
}, function() {
    // ...
});

Or bind an element to the event, passing in options and event handler:

$(window).on('resizestart', 250, function() {
    // ...
});

If you want to use the default delay setting of 250ms, simply don't include the options object:

$(window).resizestart(function() {
    // ...
});

Options

The only option available is the delay time (in milliseconds) to execute the callback after the browser has stopped being resized. The default value is 250ms. This can be passed as either a number or object:

// As a number
$(window).on('resizestart', 250, function() {
    // ...
});
 
// As an object
$(window).on('resizestart', { delay : 250 }, function() {
    // ...
});

License

This plugin is licensed under the MIT license. A copy of the license is included in this package.

Bitdeli Badge

Package Sidebar

Install

npm i jquery.resizestart

Weekly Downloads

1

Version

0.1.1

License

none

Last publish

Collaborators

  • nielse63