PDA

View Full Version : help! fixed positioning


Stephen Bawa
20th Feb 2004, 12:35 pm
Hello all,

I'm working on a site that requires (presumably) CSS to fix a h1 tag to the top left of the browser window, and a line of navigational links to the bottom right.

After hours of hair tearing, I realised that IE6 doesn't support the fixed positioning - doh!

What I'm after is an alternative method (not frames) to fixed positioning that will work in most recent IE versions.

Help! :wacko:

Stephen Bawa
20th Feb 2004, 04:50 pm
me again - I found a slither of javascript that has allowed me to fix my banner H1 tag top left:

<script language="JavaScript"><!--
function ontop() {
if (document.layers) {
document.layers['ontop'].pageX = window.pageXOffset + 200;
document.layers['ontop'].pageY = window.pageYOffset + 10;
}
else if (document.all) {
document.all['ontop'].style.position = 'absolute';
document.all['ontop'].style.posLeft = document.body.scrollLeft + 200;
document.all['ontop'].style.posTop = document.body.scrollTop + 10;
}
setTimeout('ontop()',100);
}
//--></script>
<style type="text/css" media="screen"><!--
#ontop {left:200px; top:10px; border:1px solid black;
width:200px;position:absolute;background-color:yellow;padding:4px;}
-->
</style>
<style type="text/css" media="all"><!--
#ontop {position:fixed;}
-->
</style>

What I now need is to fix my nav line bottom right. I've tried copying & amending the script, but the body tag only caters for the "ontop" ID - how can I get it to accomodate my makeshift "onbottom" ID?

francis
20th Feb 2004, 08:04 pm
IE is great, no? ;)

The CSS-discuss wiki (http://css-discuss.incutio.com/) will help you out here. It's the site maintained by people on Eric Meyer (http://www.meyerweb.com/eric/)'s CSS-discuss mailing list (http://www.css-discuss.org/). If you're interested in CSS, I'd suggest subscribing to this on digest mode (that way you won't get about 100 mails a day).

Incidentally, it's only IE for PC that doesn't support fixed positioning - IE for Mac has done for years. :angry:

Stephen Bawa
24th Feb 2004, 02:33 pm
cheers francis, that's really helpful.

While I'm here...can you recommend any good mailing list programs? I'm prepared to buy if there arent any good freeware/shareware options. Ditto for guestbook programs.

Ta mate