CSS transform-origin属性在不同的浏览器中具有不同的行为。(例如,在Chrome、FF40和FF42 (开发者版)中尝试the snippet in this question。在FF40中,转换的原点是不正确的,而在其他两个中是正确的。
我需要弄清楚transform-origin在给定的浏览器中是否正常工作,以便确定我是否应该退回到JS。因此,虽然不理想,但假阴性是可以接受的,但假阳性是不能接受的。检测transform-origin行为的最佳方法是什么
发布于 2015-09-15 06:01:40
我认为通过对answer中的代码进行一些更改,但使用一些JS,this answer将帮助您检测transform-origin属性:
if ('WebkitTransformOrigin' in document.body.style
|| 'MozTransformOrigin' in document.body.style
|| 'OTransformOrigin' in document.body.style
|| 'transformOrigin' in document.body.style) {
alert('I can Rotate!');
}https://stackoverflow.com/questions/32574273
复制相似问题