Click to See Complete Forum and Search --> : position property, value "fixed": Detecting support


pandolpho
04-27-2003, 12:42 AM
Articles such as
http://developer.apple.com/internet/javascript/objectdetection.html
explain how to check for various objects and properties supported by the current browser, but once you have determined that a browser does support the position style property, how do you determine whether a particular property value is implimented?

In particular, how do you test for support of the style, position:fixed ?

A common approach is to do browser detection to discover that Windows explorer is running, and therefore position:fixed is not supported.

But this is not very elegant or general. Anyone know how to test for support/lack of support for position:fixed ?

Nevermore
04-27-2003, 05:04 AM
Checking with JavaScript for position:fixed support will fail in 9% of browsers. Many of those will be in IE, so the property will not be supported. Why not just wait for IE7? if not, it is possible to hack around bad IE support. If you use an invalid doctype, and put position:absolute; first, then later position:fixed, I am told IE will ignore the fixed. (though I have never tried it).

pandolpho
04-27-2003, 11:48 AM
you wrote:
>Checking with JavaScript for position:fixed support will fail in 9% of browsers.
Are you implying that there is a javasript to perform this check?
The general question is how to check for implimentation of a property value, not just the property. IE on windows uses the default "static" behaviour when it encounters "fixed" or any other position value that it doesn't know about. Is there a way to ask a browser for a list of position property values that it does know about?

pandolpho
04-29-2003, 04:19 PM
I was hoping for some kind of call like:
"Give me a list of meaningful values for property blah"
I am not sure what kind of list to expect to the question
"Give me a list of meaningful values for property top"
but for
"Give me a list of meaningful values for property position"
I would espect some browsers to answer {absolute, relative, static, fixed}
Others would answer {absolute, relative, static}.

Another appoach would be to create an object both at a fixed location and at a static location and then try to interrogate the two locations in some common coordinate system to see if they were created in the same place.

Anyone know how to do this?