Une fonction propre (JavaScript pur, pas jQuery) pour vérifier quelles fonctionnalités CSS sont supportées par le navigateur est décrite dans Quick Tip: Detect CSS3 Support in Browsers with JavaScript.
fonction est la suivante:
var supports = (function() {
var div = document.createElement('div'),
vendors = 'Khtml Ms O Moz Webkit'.split(' '),
len = vendors.length;
return function(prop) {
if (prop in div.style) {
return true;
}
prop = prop.replace(/^[a-z]/, function(val) {
return val.toUpperCase();
});
while (len--) {
if (vendors[len] + prop in div.style) {
// browser supports box-shadow. Do what you need.
// Or use a bang (!) to test if the browser doesn't.
return true;
}
}
return false;
};
})();
L'utilisation est comme ceci:
if (supports('boxShadow')) {
// Do whatever
}
Il a fonctionné comme un charme pour moi! :-)
Dupliquer? http://stackoverflow.com/questions/1342994/check-browser-css-property-support – user113716