css layout for footer at bottom with dynamic ajax content changing height of page

Posted by m42 on Stack Overflow See other posts from Stack Overflow or by m42
Published on 2009-10-09T00:00:45Z Indexed on 2012/12/13 11:05 UTC
Read the original article Hit count: 236

Filed under:
|
|
|

[Update]

I actually compromised on this problem for now by foregoing the fixed footer design.

It seems that there is no problem with dynamic content moving the footer and resizing containers appropriately unless the footer is fixed to the browser bottom initially.

I hope others will eventually provide a great solution that encompasses the best of both worlds.


I spent all day trying to get the footer to move down the page to accommodate dynamically added (via ajax) content. I really need some pointers or links because I haven't found anything that helps.

Basically:

My site has some pages that begin with only a text box and a button so that the total height of the content area is only a few inches beneath the header area.

I don't have any problem getting the sticky footer working so that the footer appears at the bottom of the browser window even when there is very little content on screen.

That same css layout works fine for other pages that have content that extends beneath the browser window.

The catch:

The content has to be rendered and passed to the browser with the initial load.

The Problem:

Any content that is added to the page via AJAX after the initial load paints down the page correctly -- but the footer remains in its initial location.

Please tell me there is a fix for this. I can't post the css until checking with my boss first - if possible - and if needed, I will later - but it's just a very basic version of the many sticky footer css solutions floating around the web.

Thanks.

© Stack Overflow or respective owner

Related posts about css

Related posts about AJAX