Which css transition
property is actually used when you use the css property:
.selector {
transform: scale(n);
}
I'm trying to isolate which values are actually changing when I scale something with CSS. This works, but it is also animating everything, which I don't want to do. I only want to animate the height/width of the object:
.selector {
transition: all 0.3s linear;
}
Instead of 'all', I have tried settings 'width height', but it doesn't smoothly animate anymore. It just snaps to the final position.
The scale() CSS function defines a transformation that resizes an element on the 2D plane. Because the amount of scaling is defined by a vector, it can resize the horizontal and vertical dimensions at different scales. Its result is a <transform-function> data type.
The transition-property CSS property sets the CSS properties to which a transition effect should be applied.
The Transform property in CSS moves or modifies the appearance of an element, whereas the Transition property seamlessly and gently transitions the element from one state to another.
You can use transform
transition: transform 200ms linear;
You need the vendor prefixes in that too like this
-webkit-transition: -webkit-transform 200ms linear;
I didn't fully understand your question but I'm guessing you just want to animate the scale and nothing else on that element, if so then this is what you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With