/    Sign up×
Community /Pin to ProfileBookmark

hi guys,

i got this javascript code from [url]http://veerle.duoh.com[/url] for stick footers to the bottom of webpages.

it worked great! then all of a sudden te footer wasnt sticking on the first page (see [url]http://www.modelaircraft.co.nz[/url])

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>

[/QUOTE]

to post a comment
Java

1 Comments(s)

Copy linkTweet thisAlerts:
@skyxlinerSep 25.2004 — this is the java forums dood, posted wrong area

http://www.webdeveloper.com/forum/showthread.php?s=&threadid=44049
×

Success!

Help @Css_Calav spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...