N
N
Norum2021-07-21 00:40:12
css
Norum, 2021-07-21 00:40:12

How to make a smooth increase in the height of the image?

I'm using Owl-carousel for a gallery and I need the center slide to be a bit taller. I achieved this by increasing the height of the picture inside the block, but I can’t achieve smoothness in any way, I set the transition, but it doesn’t work. Initially I used scale, but it did not fit, as the content itself inside increases. What is the problem?

Whole site cn39614.tmweb.ru
Whole code jsfiddle.net/8mLsp9by/

60f742b91538b599992678.jpeg

.spaces-gal .owl-item img {
  transition: 0.3s;
}
.spaces-gal .owl-item.center img {
  height: 450px;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Dubrovin, 2021-07-21
@alekcena

Animation can only happen if there is something to build on.
You don't have an initial value for height
otherwise it's just switching from nothing to 450px
Set the img to (px) and it should work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question