1

I'm using Modernizr for feature detection and TransformJS for animating CSS3D properties. TransformJS uses the CSS matrix for styling translate, scale and rotate properties and it works fine, even in IE since it supports matrix transformations via the filter property.

My problem is that Opera only supports the CSS matrix since Opera Presto 2.5 which seems to be in alpha/beta right now. Is there a way to detect if a browser is capable of CSS matrix transformations?

Any help would be kindly appreciated. :)

edit: Okay, I was wrong :) Opera does have support for CSS matrix, but the values have to be unitless. But still it would be interesting to test for it.

Sam Hanley
  • 4,707
  • 7
  • 35
  • 63
Kristof
  • 304
  • 3
  • 9

1 Answers1

0

Yes, for the matrix type you need to use values without units. Anyway you can check support like this: Create an element, put to him your property (transform:matrix(...)), than look to the style of this element. If he has your property it mean that browser support it.

supportProperty = function(propertyName,propertyValue){
    let elem = document.createElement('div');
    elem.style.cssText = propertyName + ':' + propertyValue;
    return elem.style[propertyName].match(propertyValue) ? true : false;
};
supportProperty('transform','matrix(1,0,0,1,0,0)');
Michael Rafailyk
  • 433
  • 4
  • 11