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

  • Home
  • SEARCH
  • 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 8392855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:37:49+00:00 2026-06-09T19:37:49+00:00

I would specify different maximum constraint on a resizable div. For example, I want

  • 0

I would specify different maximum constraint on a resizable div.
For example, I want a maximum resize of 20px in north direction and 200px in south.

I can easily do it for only one direction with maxHeight and by restricting the handle to one direction, but I can’t manage the both at the same time.

Is it absolutely impossible ?

  • 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-09T19:37:51+00:00Added an answer on June 9, 2026 at 7:37 pm

    Please, jQuery and jQuery UI are not the same.

    jQuery UI resizable widget gives you a set of options. One of them is maxHeight as you noticed, but there is also minHeight. And of course the equivalents for width.

    If you have a fixed height item (100px), you can simply use this code to have 20px north and 200px south :

    $("#resizable").resizable(
    {
        maxHeight: 300,
        minHeight: 80
    });
    

    Now if you do not know its variable height, you can always find it out with jQuery:

    $("#resizable").resizable(
    {
        maxHeight: parseInt($("#resizable").height(),10)+200,
        minHeight: parseInt($("#resizable").height(),10)-20
    });
    

    And even better, if you’d like to be able to resize it with steps of 20px/200px, you could try using the stop event :

    $("#resizable").resizable(
    {
        maxHeight: parseInt($("#resizable").height(),10)+200,
        minHeight: parseInt($("#resizable").height(),10)-20,
        stop: function(event,ui)
        {
            $("#resizable").resizable("option","maxHeight",parseInt($("#resizable").height(),10)+200);
            $("#resizable").resizable("option","minHeight",parseInt($("#resizable").height(),10)-20);
        }
    });
    

    Now if you want to increase its height with two different handles but have separate limits, you could use the class of the handle to force another limit :

    var originalHeight = parseInt($("#resizable").height(),10);
    $("#resizable").resizable(
    {
        maxHeight: originalHeight+20,
        minHeight: originalHeight, // decrease height impossible
        start: function(event,ui)
        {
            if($(event.originalEvent.target).hasClass('ui-resizable-s'))
            {
                $("#resizable").resizable("option","maxHeight",originalHeight+200);
            }
            else
            {
                $("#resizable").resizable("option","maxHeight",originalHeight+20);
            }
        }
    });
    

    If you do not want the element to be resized smaller later on, you can also add something like that in your stop event:

    ,
    stop: function()
    {
        $("#resizable").resizable("option","minHeight",parseInt($("#resizable").height(),10));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to specify that I want FEATURE_INDETERMINATE_PROGRESS for my Activity . It
In my controller I want to specify a different View than default. Like this
I would like to specify the order of initialization of portlets when the portal
I would like to specify JNDI name for an EJB3 bean using annotation, but
I'm using NUnit mocks and would like to specify that I expect a call
Hi GPUImage community and Brad, I would like to specify the filter size (radius)
It would be convenient to be able to specify a class object by its
Is it possible to specify a condition in Count() ? I would like to
I have multiple svn code repositories. How do I specify which repository I would
I'm building a custom provider and would like to know how to specify a

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.