CSS3 transition scale but not translation

我的梦境 提交于 2019-12-22 10:43:53

问题


I couldn't find an answer to this anywhere, probably because it doesn't exist, but anyway:

Rather than defining "transition-property: transform", is it possible to define transitions for translation and scale independently?

Right now I got the following definition:

.logo {
    position: absolute;
    -webkit-transition: -webkit-transform 1s ease-out;
}

This way, when I set "-webkit-transform" to "scale($s) translate3D($x,$y,$z)" (with $s etc. being arbitrary values) both are animated, but I only want the scale to be...

Thanks for any hints in advance!


回答1:


The hacky way to solve this is to use a wrapper element and put the translate on that element.



来源:https://stackoverflow.com/questions/9841340/css3-transition-scale-but-not-translation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!