.resize() is jQuery’s legacy shorthand (since 1.0) for binding or triggering the browser resize event — typically on window. It is deprecated since 3.3 but still works in jQuery 3.x. Prefer .on("resize") / .trigger("resize").
Remember
// Deprecated (since 3.3) — still works in jQuery 3.x
$(window).resize(function () {
// viewport size changed
});
$(window).resize(); // trigger
// Modern replacements
$(window).on("resize", handler);
$(window).trigger("resize");
Many raw resize events during a drag
recalcLayout runs once ~200ms after the last event
How It Works
Raw events. Resize can fire many times during a drag.
Reset timer. Each event clears the previous timeout.
Settle. Work runs only after 200ms of quiet.
Same rule. Debounce applies whether you use .resize() or .on().
Edge Cases & Pitfalls
Watch for these when reading or migrating legacy resize code.
deprecated
Do not use in new code
.resize(handler) is deprecated since 3.3. Prefer .on("resize").
target
Bind on window
Viewport resize is delivered to window. Prefer $(window).resize(fn) / .on("resize").
count
Do not rely on call count
Some browsers fire continuously during a drag; others once at the end. Debounce instead.
removed?
Not removed like .error()
.resize() still exists in jQuery 3.x. .error() was removed in 3.0 — do not treat them the same.
Compatibility
Browser Support
The .resize() method has been part of jQuery since 1.0. Binding via .resize(handler) is deprecated since 3.3 but still functional in jQuery 3.x. Prefer .on("resize") / .trigger("resize").
✓ Deprecated · jQuery 1.0+
jQuery .resize()
Works wherever your loaded jQuery version runs. Prefer .on('resize') for new projects. Call frequency during a drag varies by engine.
100%With jQuery 3.x
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.resize()Legacy API
Bottom line: Safe in legacy jQuery projects. Migrate bindings to .on('resize') and triggers to .trigger('resize') when updating code.
Analysis
Performance Notes
Approach
Cost
Best for
Light log / width read
Cheap
Debugging, simple labels
Debounced layout / chart redraw
Cheap–moderate
Responsive UI updates
Heavy DOM work every resize
Expensive
Avoid — debounce or throttle
Legacy and modern binds have the same cost. Keep handlers light, and debounce anything that measures or redraws the DOM.
Remember
Key Takeaways
Role: legacy bind/trigger for viewport resize on window.
Migrate:$(window).on("resize", fn) — preferred since 3.3.
Trigger: use .trigger("resize") instead of no-arg .resize().
Debounce: expensive work should wait until resizing pauses.
One line:.resize() is deprecated sugar for .on("resize") / .trigger("resize") on window.
Frequently Asked Questions
The .resize() method has two roles. With a handler — .resize(handler) or .resize(eventData, handler) — it binds a function that runs when the browser viewport changes size. Bind on $(window). With no arguments — .resize() — it triggers the resize event. Both forms exist since jQuery 1.0; binding is deprecated since 3.3.
Deprecated, not removed. Binding signatures are deprecated since jQuery 3.3 — use .on("resize", handler) instead. Unlike .error(), which was removed in jQuery 3.0, .resize() still works in jQuery 3.x. Prefer .trigger("resize") over no-arg .resize() for clarity.
.resize(handler) registers a callback and does not fire immediately. .resize() with no arguments triggers the resize event on each matched element — the same as .trigger("resize"). Always bind on $(window) for viewport size changes.
Replace .resize(fn) with .on("resize", fn). Replace .resize(data, fn) with .on("resize", data, fn). Replace no-arg .resize() with .trigger("resize"). Cleanup with .off("resize"). Under the hood, .resize(handler) already delegates to .on("resize").
Yes. jQuery 3.x keeps .resize() for backward compatibility. Docs mark it deprecated since 3.3 to steer new projects toward .on() and .trigger(). Prefer the modern API in the jQuery resize event tutorial.
Yes. Browsers may fire resize continuously while the user drags a window edge. Wrap expensive layout work in debounce or throttle, whether you use legacy .resize(fn) or modern .on("resize", fn).