Linus Sylven

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromLinus Sylven
ToMe
SubjectPosition : fixed; improvement.
Date23 September 2006 09:58
Hi! Thank u 4 your tips on how to make ie5+ fake position: fixed. Works like
a charm.

I discovered that adding the following code will make the fixed elements
completely fixed. The will stop shaking completely.

In adition to your code, add something like this in the style section.

<style>
    body {
      background-image: url("images/trans.gif");
      background-repeat: no-repeat;
      background-attachment: fixed;
    }
</style>

Where 'trans.gif' can be a 1x1 pixel transparent image. This seems to make
IE calculate the 'fixed' elements position before redrawing, instead of
right after.

This will have the effect that the elements that are fixed, will behave just
like they're supposed to.

Hope you will find this interesting and useful.

Regards

Linus.
FromMe
ToLinus Sylven
SubjectRe: Position : fixed; improvement.
Date23 September 2006 13:40
Linus,

> I discovered that adding the following code will make the fixed
> elements completely fixed. The will stop shaking completely.
> background-attachment: fixed;

Unfortunately this did not work for me, but it is an interesting idea. I
will include a note so other authors can find it, in case it works for them.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromLinus Sylven
ToMe
SubjectRe: Position : fixed; improvement.
Date25 September 2006 22:26
Hi!

Thank you for your reply.

I striped down the code from a forum where I use your code, a little bit
modified, and my little extra fix, to make a working example.

Hopefully this will work for you.

Please take a look at.

[URL]

Maybe there is something else there that makes it work, doctype or whatever.


I have only tested it in IE 6, not IE 5.5, I don't have access to that
version at the moment.

Regards

Linus.
FromMe
ToLinus Sylven
SubjectRe: Position : fixed; improvement.
Date26 September 2006 09:05
Linus,

> I striped down the code from a forum where I use your code, a little bit
> modified, and my little extra fix, to make a working example.
>
> Hopefully this will work for you.

Yep, that works. Applying the same code on my own page doesn't though. I
guess I am using some style that upsets it. Good to know that your trick
works for some cases though. I am sure people will find that useful.


Cheers.

Tarquin.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.