Emulating position:fixed in IE6

T

Terry

Hi folks I need to have a banner always appear at the bottom of the
browser window. I was using position:fixed and bottom:0 to achieve it
when I realized that IE6 does not support it.

Can anybody point me to how to use the DOM to emulate position:fixed
in IE6.

Thanks,
Terry
 
T

totalstranger

Hi folks I need to have a banner always appear at the bottom of the
browser window. I was using position:fixed and bottom:0 to achieve it
when I realized that IE6 does not support it.

Can anybody point me to how to use the DOM to emulate position:fixed
in IE6.

Thanks,
Terry
The reality is you must use Javascript, CSS position:fixed fails in IE6
and perhaps IE7 if it's in quirks mode. I used the following code to
move a div back to the top in IE6. Perhaps it will help you set
something for the bottom.
Code follows. It moves a element (in my case a div) to the top after a
scroll or resize event. A timer is used to stop jerky motion during the
scrolling.


var TimerId=null;
function ChkIE()
{
if (window.attachEvent && (is.ie5 || is.ie6)) //note you will have to
set the ie6 and ie5 flags elsewhere doing a browser sniff or do it here
or use IE conditional comments
{
window.attachEvent('onscroll', fix_event);
window.attachEvent('onresize', fix_event);
}}

function fix_event()
{
//smoothe out jerky motion when no delay is done
if (TimerId != null)
clearTimeout(TimerId)
TimerId=setTimeout("ShowTime()",300)
}

function ShowTime()
{
TimerId=null
document.getElementById('ControlDiv').style.top =
document.getElementsByTagName('html')[0].scrollTop+document.getElementsByTagName('body')[0].scrollTop;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top