Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 698975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:20:05+00:00 2026-05-14T03:20:05+00:00

I have a div element which is made jquery Resizable. It has alsoResize option

  • 0

I have a div element which is made jquery Resizable. It has alsoResize option set, so other elements resize simultaneously.

What I want to do, is to set size of this Resizable div element programmatically in such way, that all Resizable logic is triggered (especially this alsoResize option is taken into account).

How can I achieve that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:20:06+00:00Added an answer on May 14, 2026 at 3:20 am

    Update: It looks like the internals of jQuery UI have changed dramatically since I answered this and firing the event no longer works.

    There’s no direct way to fire the event anymore because the resizable plugin has been fundamentally changed. It resizes as the mouse is dragged rather than syncing items up at the end. This happens by it listening for the internal resize propagation event for resizable plugins which is now fired by the _mouseDrag handler. But it depends on variables set along the way, so just firing that even internally won’t help.

    This means even overriding it is messy at best. I’d recommend just manually resizing the alsoResize elements directly, independent of the UI widget altogether if that’s possible.

    But for fun let’s say it isn’t. The problem is that the internals of the plugin set various properties relating to previous and current mouse position in order to know how much to resize by. We can abuse use that to add a method to the widget, like this:

    $.widget("ui.resizable", $.ui.resizable, {
        resizeTo: function(newSize) {
            var start = new $.Event("mousedown", { pageX: 0, pageY: 0 });
            this._mouseStart(start);
            this.axis = 'se';
            var end = new $.Event("mouseup", {
                pageX: newSize.width - this.originalSize.width,
                pageY: newSize.height - this.originalSize.height
            });
            this._mouseDrag(end);
            this._mouseStop(end);
        }
    });
    

    This is just creating the mouse events that the resizable widget is looking for and firing those. If you wanted to do something like resizeBy it’d be an even simpler end since all we care about is the delta:

    var end = $.Event("mouseup", { pageX: newSize.width, pageY: newSize.height });
    

    You’d call the $.widget() method after jQuery UI and before creating your .resizable() instances and they’ll all have a resizeTo method. That part doesn’t change, it’s just:

    $(".selector").resizable({ alsoResize: ".other-selector" });
    

    Then to resize, you’d call that new resizeTo method like this:

    $(".selector").resizable("resizeTo", { height: 100, width: 200 });
    

    This would act as if you instantly dragged it to that size. There are of course a few gotchas here:

    • The "se" axis is assuming you want resize by the bottom right – I picked this because it’s by far the most common scenario, but you could just make it a parameter.
    • We’re hooking into the internal events a bit, but I’m intentionally using as few internal implementation details as possible, so that this is less likely to break in the future.
    • It could absolutely break in future versions of jQuery UI, I’ve only tried to minimize the chances of that.

    You can play with it in action with a fiddle here and the resizeBy version here.


    Original answer:

    You can do this:

    $(".selector").trigger("resize");
    

    alsoResize internally rigs up a handler to the resize event, so you just need to invoke that 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have DIV element which only has a few lines in and a background
I have this jquery script which suppose to hide/show div element base on the
I have a div which contains 2 elements. First element is a span and
I have a div element which consists of list elements eg: java, ror, .NET.
I have a div element which acts as a global contianer for my webpage,
I have wrote a script to detect when I reach the div element which
suppose I have a simple container which have three element: <div> <span>hello world</span> <input
I'm with a little problem. I have the container div for some elements which
I have a problem using fadeIn() on div that contains elements which positions are
I have an SVG element in which I have made a foreignObject. The foreignObject

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.