Download the PHP package webcito/jquery-resize without Composer
On this page you can find all versions of the php package webcito/jquery-resize. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jquery-resize
jQuery Resize Plugin
A lightweight jQuery plugin that adds a robust resize event to any HTML element using ResizeObserver. Unlike the native window resize event, this plugin tracks size changes of individual elements and provides detailed information about the change.
Features
- Element-level resize tracking: Monitor any element, not just the
window. - Detailed change data: Get the axis of change (
x,y, orboth), new dimensions, previous dimensions, and the calculated difference. - Debouncing: Built-in support for debouncing to prevent performance issues during rapid resizing.
- Debug Mode: Optional visual feedback directly within the element for easier development.
- Flexible API: Support for both event listeners and direct callback functions.
- Manual Triggering: Ability to manually trigger a resize check.
Installation
Include jQuery and the plugin in your project:
Or via Composer:
Usage
Basic Initialization
Initialize the plugin on your elements:
With Event Listener
The plugin triggers a standard jQuery resize event but passes additional arguments to the handler:
With Callback Function
You can pass a callback directly to the .resize() method:
Configuration Options
You can pass an options object to the initialization:
Global Configuration
Set default values for all future initializations:
Manual Trigger
Force a resize calculation and event trigger:
API Reference
Arguments for Event/Callback
| Argument | Type | Description |
|---|---|---|
axis |
string |
The axis that changed: 'x', 'y', or 'both'. |
afterSizes |
object |
The new dimensions: { width: number, height: number }. |
beforeSizes |
object |
The dimensions before the resize: { width: number, height: number }. |
diffSizes |
object |
The difference between new and old sizes: { width: number, height: number }. |
Options
| Option | Type | Default | Description |
|---|---|---|---|
wait |
number |
400 |
Debounce time in milliseconds. |
debug |
boolean |
false |
If true, overlays resize info on the element. |
Requirements
- jQuery 3.0 or higher
- Modern browser with
ResizeObserversupport (Chrome 64+, Firefox 69+, Safari 13.1+, Edge 79+)
License
This project is licensed under the proprietary License - see the composer.json file for details.