I'm trying to apply different styles for browsers that don't support CSS3 3d transforms. But for some reason, when I preview the page in opera it applies the styles for a 3D browser, even though it doesn't (to my knowledge) support CSS3 3d transforms.
function has3d() {
var threedee, has3d;
threedee = document.createElement('div');
threedee.style['transform'] = 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)';
document.body.insertBefore(threedee, document.body.lastChild);
has3d = window.getComputedStyle(threedee).getPropertyValue('transform');
if( has3d !== undefined ){
//Apply styles for awesome browsers that do support 3d
}
else {
//Apply Styles for lame browsers that don't support 3d
}
}
I know that the script is working, because when I switch the classes in the conditional it works in chrome, safari, and firefox. I just can't figure out why Opera seems to be saying that it supports 3d transforms. Is there something special I need to do for opera?