H
Helbrax
I am working on a project that needs to use use the value of "fixed"
in the "position" property of the style element for an html object.
However, IE6 doesn't support "position:fixed", so I need to switch to
"position:absolute" instead if it isn't supported.
Rather than do a crude test for IE6(via browser sniffing, or inference
based on supported features/quirks), I'd rather do a behavior test to
see if "position:fixed" is being reported properly. The only problem
is, I'm not sure how to go about doing it.
I can create a div, set it's style position to "fixed" and set it's
left property to say, 100px, then test the elements offsetLeft
property. This actually works(ie6 reports 0, other browsers report
the actual offset). However, I'm not sure how widely supported
offsetLeft is, and I don't want to fall back to "absolute" positioning
when "fixed" would work, just because offsetLeft isn't working as
intended(or not available at all).
Any thoughts on how to do this?
in the "position" property of the style element for an html object.
However, IE6 doesn't support "position:fixed", so I need to switch to
"position:absolute" instead if it isn't supported.
Rather than do a crude test for IE6(via browser sniffing, or inference
based on supported features/quirks), I'd rather do a behavior test to
see if "position:fixed" is being reported properly. The only problem
is, I'm not sure how to go about doing it.
I can create a div, set it's style position to "fixed" and set it's
left property to say, 100px, then test the elements offsetLeft
property. This actually works(ie6 reports 0, other browsers report
the actual offset). However, I'm not sure how widely supported
offsetLeft is, and I don't want to fall back to "absolute" positioning
when "fixed" would work, just because offsetLeft isn't working as
intended(or not available at all).
Any thoughts on how to do this?