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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:16:11+00:00 2026-05-25T15:16:11+00:00

In my page I load content dynamic in a div by .load(). In this

  • 0

In my page I load content dynamic in a div by .load(). In this loaded div I have a subanvi where I load additional content in the loaded content. This works perfect so far.

But after the load I want to animate the height of the wrapper (which is all alround the page, except the footer) but don’t know how cause my function only gets the hight of the first shown content. How do I get height of the new loaded content?

This is my function:

$(function(){

        var 
        $subContent = $(".subcontent"),
        $subWrap    = $(".maincontent"),
        $newWrap    = $("#wrapper"),
        subHeight   = 0,
        $el;

        $newWrap.height($newWrap.height());
        subHeight = $newWrap.height() - $subContent.height();

        $("ul.linkbox li a").live('click', function (e) {
    newLink = $(this).attr("href");
        e.preventDefault();

    $(".textbox").find(".subcontent").fadeTo(200,0, function() {

    $(".textbox").load(newLink +  " .subcontent" , function() {

    $(".subcontent").fadeTo(200,1, function() {

        $newWrap.animate({height: subHeight + $subContent.height() + "px"});

    }); 
    }); 
    });   
        });

});
  • 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-25T15:16:12+00:00Added an answer on May 25, 2026 at 3:16 pm

    You calculated subHeight before any animation happens

    subHeight = $newWrap.height() - $subContent.height();
    

    Then used it after some animation happened to your elements

     $newWrap.animate({height: subHeight + $subContent.height() + "px"});
    

    This may affect your code behavior.
    I would suggest recalculate the subHeight again when you need it:

    $newWrap.animate({height: $newWrap.height() - $subContent.height() + $subContent.height() + "px"});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to change my page title <title></title> after content is loaded in #container div?
I have a jsp page which should load a popup using ajax. The content
I have this line of code for page load: if ($(input).is(':checked')) { and it
I have create dynamic listview based on database but the problem is to load
I have some div's on my page coded as <div id=1>Click Me to load
I want to load a dynamic content to specific div name with multiple querystring
I am assigning ViewState[something] in Page Load of content page and when I try
I have a page that dynamically loads content based on a user pushing a
Here's a my Default.aspx page (with unnecessary details excised): <asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder1 Runat=Server> <div
I'm creating a website where I'm doing ajax requests to load some dynamic content

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.