mck89 mck89 - 3 months ago 12
Javascript Question

check browser css property support

Is it possible in javascript to know if a css property is supported by the client browser? I'm talking about the rotation properties of css3, i want to execute some functions only if the browser supports them.

Answer

I believe you can do it this way:

if ('WebkitTransform' in document.body.style 
 || 'MozTransform' in document.body.style 
 || 'OTransform' in document.body.style 
 || 'transform' in document.body.style) 
{
    alert('I can Rotate!');
}
Comments