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 8677681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:31:30+00:00 2026-06-12T20:31:30+00:00

I have a widget based on jQuery UI’s resizable (version 1.8.24) which is filled

  • 0

I have a widget based on jQuery UI’s resizable (version 1.8.24) which is filled with items immediately upon being displayed, and can then be cleared and filled again based on user’s actions. It looks roughly like this:

<div class="dialog ui-resizable">
    <div class="dialog-header">…</div>
    <div class="dialog-contents">…</div>
    <div class="dialog-controls">…</div>
    <div class="ui-resizable-handle ui-resizable-e" style="z-index: 1000"></div>
    …
</div>

It is cast into a Resizable using this code:

myDialog.resizable(
            { alsoResize: myDialog.find(".dialog-contents"),
              minHeight: minH,
              minWidth: minW,
              maxHeight: maxH,
              maxWidth: maxW
            }).show().focus();
updateMyDialogContents();

If the widget was not resized manually yet, it grows and shrinks along with contents of div.dialog-contents. This is undesired. However, if any of the resizing handles were dragged, it starts behaving like I want it to, i. e. keeps its size constant regardless of what happens inside div.dialog-contents.

How do I make it keep its size constant from the very beginning?

I have noticed that _mouseDrag method of resizable sets width and height to their actual values in the DOM element’s style attribute. Normally I would set the style attribute myself immediately after rendering the widget, but it has a number of inner elements in alsoResize, so this does not work.

Is there a way to call _mouseDrag programmatically with zero coordinate deltas so the widget will think that a real "mousedrag" event was triggered? If this was possible, I would solve this issue by simulating a mouse drag immediately after the widget was initialized.

I have tried things like

dlg.data("resizable").
    _mouseDrag(new $.Event("mousedrag",
                           { dragState: "end",
                             dragDeltaT: 0,
                             dragDelta: 0,
                             dragDeltaX: 0,
                             dragDeltaY: 0 }));

with different events with no apparent success (it throws an error because some attribute always seems to be missing).

Edit 1: jQuery version.

  • 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-06-12T20:31:31+00:00Added an answer on June 12, 2026 at 8:31 pm

    I have settled for this hack:

            var noStretchingHack = function (widget) {
                var contents = widget.find(".dialog-contents");
                var hDiff = widget.height() - contents.height();
                widget.css({width: "600px",
                            height: (400 + hDiff) + "px",
                            top: "0px",
                            left: "0px"});
                contents.css({width: "600px",
                              height: "400px"});
                widget.trigger("resize");
            };
    

    I pass it as a callback to the contents updater function so that it executes right after the contents are filled for the first time. I am not proud of myself and I would love to hear about a more elegant solution, if it exists for jQuery UI 1.8.24.

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

Sidebar

Related Questions

I have a button which I style using jQuery's UI's button . <button class=widget-button>Submit</button>
can a widget have a marquee textview? if so how would i implement it?
I have web-pages based on widget and I have given all the div the
In the jQuery autocomplete/menu widget (the autocomplete widget is based on the menu widget,
I have a jquery calendar widget that do query several event sources on the
I have a textbox hooked up to jQuery UI Autocomplete widget. The source for
We're looking for the best jQuery-based user interface library we can find. It doesn't
I'm trying to modify a twitter widget where based on the dropdown, users can
I have three tabs in a Jquery UI tabs widget. Inside of the tabs
In my django admin.py I have a custom widget based on a select menu.

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.