I've played around with that myself but haven't found a satisfactory answer.
First, older browsers don't support position: fixed, so you won't be able to stop IE6 scrolling the footer which will be treated as position: absolute.
If you have a footer which is say 50px high, then make your container for the rest of the page have a margin-bottom of 50px as this will leave a space for the footer so that when you scroll the full amount the bottom of the containing div won't be covered by the footer.
See
http://www.wickham43.supanet.com/tut...footerfix.html
which is the best I can do without using a hack.
If you want to risk a hack (which works in IE6, IE7, Firefox, Opera and Safari for Windows which covers the most popular browsers) see
http://www.wickham43.supanet.com/tut...ixexample.html
which fixes a header and footer to the top and bottom of the viewing window.
Neither of the above will move the footer up from the bottom of the window if the rest of the page has very little content (except IE6 which just puts the footer under other content all the time with my first example). I think you would have to use javascript as you describe, but I think that would only work with the default screen resolution of a viewer's computer, not if he changed the window size away from his default screen resolution just before or after downloading your page.
Last edited by Wickham; 03 Dec 2007 at 03:21 PM.
Code downloaded to my PC will be deleted in due course.
WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.