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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:22:52+00:00 2026-06-02T08:22:52+00:00

I have some blocks with different heights depends on it’s content: JSFiddle . I

  • 0

I have some blocks with different heights depends on it’s content: JSFiddle.

I want to allow make height more than content’s height but not less than it.

That’s simple:

        $(".block").each(function(){
            $(this).resizable({
                 handles: 's',
                 minHeight: $(this).height()
            });                     
        }); 

but some blocks (4th in example) already have fixed height and if I use code above I can’t make this block smaller than it already is.

Is there any way to set content’s height as minHeight to avoid empty space and disallow to make block smaller than it’s content?

I have an idea to place all block’s content into another div and set it’s height as minHeight but maybe there is another way without changes in element’s structure?

[UPD] @Eopin
If I don’t want to reset heights my code looks like this:

        $(".block").each(function(){
            tmp = $(this).css('height');
            if (tmp != 'auto') {
                $(this).css('height', 'auto');
            }
            $(this).resizable({
                 handles: 's',
                 minHeight: $(this).height()
            });     
            if (tmp != 'auto') {
                $(this).css('height', tmp);
            }                               
        }); 

It works and I don’t see visual changes when script works, the speed is also normal for blocks < 50. Looks like solution.
I’ll wait a couple of days for other answers and then close my quesion.

  • 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-02T08:22:55+00:00Added an answer on June 2, 2026 at 8:22 am

    Try unsetting the height property of the element by setting it to auto:

    $(this).css('height', 'auto');
    

    And if ever the blocks are using the height attribute rather than the css property, then:

    $(this).attr('height', '');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have some blocks of code that you would like to prevent execution
I have some the page elements split into separate visual blocks. I am currently
Let's say I have some Jinja2 template with several blocks in it: {% block
I have a GtkVBox with some labels and some empty blocks in it ...
I have different table rows, each of it contains some information text which should
I have a page with some clickable <div> elements, and I want to change
1) We have <body> , it's height and width varies (different resolutions). 2) Many
I have some difficulties for using Ruby block, passing in a method. As in
I have some mark-up like so: <div class=slideshow> <div class=slide style=display:block;></div> <div class=slide style=display:none;></div>
I have seen some developers use the return statement in a catch block. Why/when

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.