wilson@cpuworks.com
01-02-04, 09:05 AM
How do I tell if the user's browser properly supports a particular CSS feature?I know I can say "if (document.all)", that sort of thing. But I'm finding that one element ("clip") doesn't work properly on some browsers. My code says something like " document.getElementById('area').style.clip='rect(1 00 200 300 0)';"
This works fine on some browsers, but is ignored on others. (The example shown should show only the part of layer "area" from 0,100 to 200,300 .) No error is thrown, just no clipping is done. Is there a way to test if the feature is supported, or do I have to hand-test all combinations of browser, version, and OS (Windows or Unix are targets) and then fudge-code it? I'm fine with requiring a new-enough browser to support the document.getElementById method, but this kind of tweaking is irritating and hard to support.
This works fine on some browsers, but is ignored on others. (The example shown should show only the part of layer "area" from 0,100 to 200,300 .) No error is thrown, just no clipping is done. Is there a way to test if the feature is supported, or do I have to hand-test all combinations of browser, version, and OS (Windows or Unix are targets) and then fudge-code it? I'm fine with requiring a new-enough browser to support the document.getElementById method, but this kind of tweaking is irritating and hard to support.