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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:12:00+00:00 2026-06-04T04:12:00+00:00

After I got some help from a couple fellow members suggesting that the solution

  • 0

After I got some help from a couple fellow members suggesting that the solution to my problem here:
DIV "100%" height, stretch from top DIV to bottom footer to accommodate background
was JavaScript / jQuery, I found something online:

http://nicholasbarger.com/2011/08/04/jquery-makes-100-height-so-much-easier/

However, I need some customizing. At the moment it does what I need it to do. When I have a little content, it’ll push my DIV to the entire height of the browser.

But when I have MORE content, the content keeps going, but the DIV doesnt expand.

How can I customize the following script so it detects that if there’s enough content it doesn’t need to adjust the height?

<script>
//Initial load of page
$(document).ready(sizeContent);

//Every resize of window
$(window).resize(sizeContent);

//Dynamically assign height
function sizeContent() {
    var newHeight = $("html").height() - $("#header").height() - $("#content-header").height()- $("#footer-wrapper").height() + 6 + "px";
    $("#content").css("height", newHeight);
}
</script>
  • 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-04T04:12:00+00:00Added an answer on June 4, 2026 at 4:12 am
    function sizeContent() {
        var html = $("html").height(),
            content = $("#content").height(),
            header = $("#header").height(),
            contentHeader = $("#content-header").height(),
            footerWrapper = $("#footer-wrapper").height(),
            availableSpace = html - header - contentHeader - footerWrapper;
    
        if (content < availableSpace) {
            $("#content").css("height", availableSpace + 6 + "px");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After some help here, I've got WPF using the windows.forms notifyIcon class (It's not
So here I am,got some help from some web tutorials and performing following Asynchronous
After some searching, I got the following solution : reference . CLLocationCoordinate2D* new_coordinate =
After some help and reviewing of the code I got this working without any
I got some help on here last night about getting an the index of
I've got a SharePoint problem which I need some help with. I'm creating some
I got this message when doing some javascript programming, and after some google searches,
I've got an after insert trigger that works well. However, I want it to
After reading Eric Lippert’s answer I got the impression that await and call/cc are
I've got a stored proc that after a period of weeks will start 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.