Nancy E. Sosna Bohm wrote:
> Searching in Google, I keep find people talking about position:fixed working
> in IE.
> It's not working that I can see, that is, a div with position:fixed is
> scrolling with the page in IE, instead of staying in one place while the
> page scrolls. This is happening in IE6-8.
> I'm using a tiny script to make it work in IE, though it's a little jerky.
> But is this a known bug, and if so, why do people say it's working for them?
> 
> Thanks,
> Nancy

Hi Nancy,

Fixed positioning DOES work in IE and position:fixed should work just
fine in IE7-8 without any need for scripting. It's IE6 that's the real
bear. I use the snippet below to emulate fixed positioning in IEs older
than IE7. To know why your page isn't behaving as expected, we'd need to
see it in context (i.e. a link to an online example).

Here's the code I use:
<style type="text/css">
#fixed {
  /**
   * Standards compliant browsers will fix this box on the page.
   *******************************************************************/
  background:                #ccc;
  position:                  fixed;
  top:                       0;
  width:                     100%;
  }
</style>
<!--[if lt IE 7]>
<style type="text/css">
html {
  /**
   * This fixes the jumpiness in IE6
   * when using expressions for fixed positioning.
   *******************************************************************/
  background-image:          url('about:blank');
  background-attachment:     fixed;
  }
#fixed {
  /**
   * Fixed positioning emulation expression.
   *******************************************************************/
  position:                  absolute;
  top:             expression(((e=document.documentElement.scrollTop)?
                                     e:document.body.scrollTop)+'px');
  }
</style>
<![endif]-->

Hope it helps.
--Bill


-- 
/**
 * Bill Brown
 * TheHolierGrail.com & MacNimble.com
 * From dot concept...to dot com...since 1999.
 ***********************************************/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to