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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:29:45+00:00 2026-05-25T13:29:45+00:00

I have a div, and it has two children absolutely positioned. and the top

  • 0

I have a div, and it has two children absolutely positioned. and the top children moved 50px (top:50px)and it is growable, as well bottom child is moved down from the end of the parent like 50px (bottom:-50px), as well it can growable according to the content client will palce.

Now i need to vertically center this parent, so i need the total height of the parent including the child whatever then moved from out of parent and as much that may grown. how can i get this total height?

i used this function, but i am not get the proper height of the div. it shows only the parent height, it is not include the children what it moved and it has the height.

alert($('#imgHolder').outerHeight(true));

any one can help me to get the total height?

  • 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-25T13:29:46+00:00Added an answer on May 25, 2026 at 1:29 pm

    When you absolutely position an element it removes it from the flow of the page. So height, width, outerwidth, scrollWidth etc are not going to work. You will need to do the calcuations yourself.

    Your description is really hard to follow (a picture would help along with what you want to measure), but it sounds like your child elements lie outside some portion of their parent. To have them included in the screen height, get their positions and then manually calculate the bounding box.

    I’m not going to figure out all the calculations for you, but you should be able to use these figures to calculate yourself. Assuming the parent is relatively positioned the position property of child will be in relation to that.

    //option1 - based on position property find top/bottom
    childHeight = $('#child').height();
    childWidth = $('#child').width();
    childTop = $('#child').position().top;
    childBottom = childTop + childHeight;
    childLeft = $('#child').position().left;
    childRight = childLeft + childWdith;
    

    Or if you can use offset instead then just get each child div’s top and bottom. Keep whatever the smallest and largest values are and that is your height.

    //option2 - based on offset property find top/bottom
    var top = null;
    var bottom = null;
    foreach (child) { 
        childTop = child.offset().top;
        childBottom = child.offset().bottom;
        if (top === null || top <== childTop) { top = childTop; }
        if (bottom === null || bottom >== childBottom) { bottom = childBottom; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two div -elements, the top one has the height of 40% and
I have two div's one has textbox in it and other just plain text.
I have some div. I need in two children there. The first should be
I have a div that has two buttons in it that has a jQuery
I have two div's which I would like to be clickable. Each div has
I have two div(s) with different IDs. First div has a jquery slider and
I have a div that has multiple children divs. inside of the children divs
I have a middleContent div which has two sub-divs acting as columns. The middleMain
I have a view page that has two DIV tags. If the session[UserType] =
I have a div (article) which has two childs (header and #content_outer). Header has

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.