/    Sign up×
Community /Pin to ProfileBookmark

Browser Compatibility Issues

Hello.

I’m almost finished with the development of my business site. Mostly, I just have to work out the aesthetics of it. However, when doing some cross-browser testing, I discovered a problem.

My site works fine in FireFox and Chrome. However, in Internet Explorer 8, a certain piece of code doesn’t seem to be working. I haven’t had a chance to test it in IE9, but I was hoping someone here might be able to recognize the compatibility issue.

Here is what should be happening and what happens in FireFox and Chrome:
[img]http://incinera.com/IncineraFF.gif[/img]

But here’s what happens in IE8:
[img]http://incinera.com/IncineraIE.gif[/img]

As you can see, the footer doesn’t show up. It is a fixed div element that sits at the bottom of the browser window while the page content scrolls behind it. This works just fine in all other browsers. I’m aware that older versions of IE have some quirks, but I haven’t been doing this long enough to know how to get around them.

Here is the JavaScript code for the function that positions the div when the page loads or if the browser is resized:

[code]
function fixFooter()
{
var footer = document.getElementById(“footer”);
var newTop = window.innerHeight – footer.offsetHeight;
footer.style.top = newTop + “px”;
}
[/code]

And here is the CSS style definition for it:

[code]
#footer { width: 100%;
text-align: center;
position: fixed;
left: 0;
height: 4em;
background-color: #990000;
border-top-style: outset;
border-top-color: white;
border-top-width: 2px;
z-index: 99;
}
[/code]

The element itself is just a div. I don’t know that the code for that is necessary. There isn’t anything special about it.

Any help would be greatly appreciated.
Thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@007JulienNov 05.2011 — This page show that your problem is probably the window.innerHeight ! Give and id at your body and use offsetHeight or a position absolute with bottom=0 ?

Further the DOCTYPE of your page could be too important...
Copy linkTweet thisAlerts:
@TileaauthorNov 05.2011 — I'm not sure what you mean by 'too important', but using offsetHeight for the body and an absolutely positioned element would put it at the bottom of the page, not the bottom of the browser window. If I have to, I'll make it so the element just sits at the bottom for earlier versions of IE, but I know there's a way to get the effect I'm going for.
×

Success!

Help @Tilea 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,
)...