hi guys,
i got this javascript code from [url]http://veerle.duoh.com
it worked great! then all of a sudden te footer wasnt sticking on the first page (see [url]http://www.modelaircraft.co.nz
now it works sometimes, sometimes not. ONLY for that first page. at my work and friends house’s the footer does not stick, ONLY on that page.
i have copied the code from the other pages where it works everytime, but no luck.
can some please explain or see something wrong?
or another way to do this?
thanx
[QUOTE]
<head>
<title>Model Aircraft</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<style type=”text/css” media=”all”>
@import “model.css”;
</style>
<script type=”text/javascript”>
<!–
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == ‘number’) {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
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.position = ‘relative’;
footerElement.style.top = (windowHeight – (contentHeight + footerHeight)) + ‘px’;
}
else {
footerElement.style.position = ‘static’;
}
}
}
}
window.onload = function() {
setFooter();
}
window.onresize = function() {
setFooter();
}
/* start mail list validation
var errormessage = “”
function validate()
{
errormessage = “You have the following errors:n”
correct = “Thank you, your details have been entered”
Name()
Email()
Country()
if (errormessage == “You have the following errors:n”)
{
alert(correct)
return (true);
}
else
{
alert(errormessage)
return (false);
}
}
function Name()
{
var name = window.document.index.E_Name.value
if (name == “”)
{
errormessage = errormessage + “- Please enter your Namen”
}
}
function Email()
{
var email = window.document.index.E_Email.value
if (email == “”)
{
errormessage = errormessage + “- Please enter your Emailn”
}
else if (email.indexOf(“@”)==-1)
{
errormessage = errormessage + “- Your Email is not a valid Emailn”
}
}
function Country()
{
var country = window.document.index.E_Country.options[window.document.index.E_Country.selectedIndex].value
if (country == “Select your County”)
{
errormessage = errormessage + “- Please enter your Countryn”
}
}
//–>
</script>
</head>