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 relatively new to jquery and javascript and am trying to pass a unique
Thanks for reading. I'm a bit new to jQuery, and am trying to make
I'm trying to add a new node to an jQuery SimpleTree , but all
I'm new to both ASP.Net MVC and jQuery and what I'm trying to do
I'm new to jquery and asp.net so please forgive if this is an obvious
I'm new to jQuery so hopefully there is an easy answer to this. I
So I am pretty new to JQuery and just spent 5 hours getting this
I'm relatively new to JQuery. I'm trying to understand how to select a child
I am new to jQuery.just learn and use it for 3 weeks until now.
I am new to JQuery. I'm reading JQuery in action, but only up to

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.