How to make transition dependent on block height?
How can I implement the transition effect with a formula using js or css? I need the transition speed to depend on the height of the block. Tell me how can I implement this?
2 Replies
with JS, you can get the height of an element with
element.getBoundingClientRect().height
it will return a pixel value (without the unit) . that value you can pass to CSS with a custom property and calculate with that
for example
If this is not what you need, please explain a bit more and provide simple example in CodePen.Thank you, this is exactly what I need