Does anyone know how I would detect transform: translate3d(x,y,z)
support is available?
My issue is that I want to use translate3d
across b
Was tinkering around with a way to check for 3d support.. used this implementation from Jeffery Way in this article. Allows for less code and more use cases ;)
/**
* Test For CSS3 property support
* use 'perspective' to test for 3d support
*/
var supports = (function() {
'use strict';
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) {
return true;
}
}
return false;
};
})();
if(supports('perspective')) {
// do 3d stuff
}