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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:57:30+00:00 2026-05-13T09:57:30+00:00

I am new to Jquery, and trying to follow an example on JqueryUI Display

  • 0

I am new to Jquery, and trying to follow an example on JqueryUI Display Grid, and putting it on a div.

So the code basically looks like this:

JS code:

$('#demoList').sortable();
$('#demoList').disableSelection();
var contentHeight  = $('#demoContent').height() + 200; 
$('#demoContent').animate({height: contentHeight});

HTML code:

<div id="demoContent">
        <ul id="demoList">
            <!-- <li> items generated based on the items from MySql -->
            <li class="ui-state-default"><img src="1.jpg" width="100px" height="100px"></li>
            <li class="ui-state-default"><img src="2.jpg" width="100px" height="100px"></li>
            <li class="ui-state-default"><img src="3.jpg" width="100px" height="100px"></li>
            <li class="ui-state-default"><img src="4.jpg" width="100px" height="100px"></li>
            <li class="ui-state-default"><img src="5.jpg" width="100px" height="100px"></li>
            <!-- There could be more than 5 images... -->
        </ul>
</div>

Currently I could only add a fixed 200px to my contentHeight, but I need it to be more specify based on the rows of items that I could have generated from the database. My question is, how is it possible to let demoContent “grow” its height based on the number of rows of images there could be (say if each row could contain up to 5 images)?

Thank you very much.

  • 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-13T09:57:30+00:00Added an answer on May 13, 2026 at 9:57 am

    if ive understand you correctly this has nothing to do with javascript 🙂 you just need a clearer and remove this height() stuff.

        <div id="demoContent">
               <ul id="demoList">
                        <!-- items -->
               </ul>
               <div style="clear: both;"> </div>
        </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a bit new to CSS/html. I am trying to include this jquery plugin
I am trying to use this http://odyniec.net/projects/imgareaselect/examples.html Jquery Cropping example to get the dimension
I'm trying to follow the tutorial to use jQuery UI plugin. I'm new to
I'm new to jQuery and trying to combine the use of a tooltip plugin
I'm new to jQuery and trying to change an attribute of an SVG element
I've been trying to use the new jquery-ui, and all but the resizable function
I am new to Jquery and am trying to store the location and size
I am new to jQuery and am trying to fire a function on a
I fairly new to JQuery and perhaps trying to achieve something that might be
I'm rather new to jQuery and I'm trying to make a cool little 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.