Forum Moderators: not2easy
I'm using the "list apart" footer hack to fix the problem and it works on pages that don't have the "norm" sheet.
What I need is to edit this code :
code:
function setFooter() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var contentHeight = document.getElementById('container').offsetHeight;
var footerElement = document.getElementById('footer');
var footerHeight = footerElement.offsetHeight;
if (windowHeight - (contentHeight + footerHeight) >= 0) {
footerElement.style.top=(windowHeight-(contentHeight+footerHeight))+'px';
}
else {
footerElement.style.position='static';
}
}
}
}
to test the "norm" sheet height - easy to do , just add this :
var normheight = document.getElementById('norm').offsetHeight;
etc ..
but if the "norm" sheet does not exist on the page then IE errors. How can I test if the norm sheet exists or not? I think I need something like (isobject)?
Any hints?
This is the code for the fix
unction setFooter() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
if (document.getElementById('norm')) {
var cHeight = document.getElementById('norm').offsetHeight;
} else {
var cHeight = document.getElementById('container').offsetHeight;
}
var footerElement = document.getElementById('footer');
var footerHeight = footerElement.offsetHeight;
if (windowHeight - (cHeight + footerHeight) >= 0) {
footerElement.style.top = (windowHeight - (cHeight+footerHeight)) + 'px';
}
else {
footerElement.style.position = 'static';
}
}
}
}
So does anyone know how to get it to detect the page is longer if it contains tables?