Weblog

Fix for IE position fixed

Hi, after a loooong time of silence due to several reasons, including the working on a version 3, I decided to share with you a minor fix for the known Internet Explorer position:fixed bug. In IE, this CSS rule won't work, and position will not be fixed on screen. There are some other fixes for this problem, using specific CSS hacks, but all of them convert position:absolute to position:fixed (which I found to be a worst problem) or add unnecessary markup. The fix I show you here was made in javascript using very few lines. The only drawback is that you have to be in Quirks mode. Update: no need to now.

Beware if you're using other onload events, since this will overwrite yours. If that is your case, use an event handler to avoid this problem.

Comments on this entry

  1. 2004-04-02 09:37:44

    una obra de arte el script... no podría ser más mínimo... el problema con las soluciones escripteadas es que "pierde frames", como que va de a saltitos... el de devnull queda realmente fixed... aunque requiere quirks mode...

  2. 2004-04-02 11:28:26

    hola, pues si, va a saltitos, pero es una eleccion a tener en cuenta por el codigo reducido y porque no interfiere con los position:absolute, como he comentado en el post. Un posible arreglo sería usar intervalos y un manejador de eventos, para que no se notase el salto o incluso se animase al cambio de posición, pero en este caso quería algo muy sencillo. Gracias por el comentario. Saludos.

  3. 2005-03-11 04:09:35

    Sorry, dunno why, but this unfortunately doesn't work with Safari, sigh.
  4. 2005-03-11 04:10:26

    • jhbdfgdhfg
    • [e]
    Sorry, dunno why, but this unfortunately doesn't work with Safari, sigh.

Closed

Due to spam bullshit this weblog has been closed to comments, it was impossible to keep my blacklist script updated. You can still figure out my email and send me your message. Sorry.

Change preferences

Change preferences

License

Creative Commons 2001-2004. Sergi Meseguer

RSS syndication

rss (1, 2 ), xhtml, css, taw