H
H
Hosting Yaroslavl2018-03-24 12:57:15
css
Hosting Yaroslavl, 2018-03-24 12:57:15

How to make two effects with different CSS delay (transition)?

I have two elements in the .product div. I want that when hovering .vm-product-descr-container - immediately smoothly increase the height, and .addtocart-area smoothly appears on top of it with a delay. When the focus is lost, it should be the other way around: .addtocart-area - disappeared smoothly - immediately, and .vm-product-descr-container - smoothly reduced the height with a delay.
I do it like this:

.product .vm-product-descr-container {
height:60px!important;
transition: all 0.3s linear 0.3s;}

.product:hover .vm-product-descr-container {
height:100%!important;
transition: all 0.3s  linear 0;}


.product .addtocart-area {
opacity:0;
 transition: all 0.3s  linear 0;}

.product:hover .addtocart-area {
opacity:1;
transition: all 0.3s linear 0.3s;}

.vm-product-descr-container - changes height with a delay on both hover and focus loss.
.addtocart-area - appears smoothly without any delay, and disappears instantly and also without delay.
What am I doing wrong?
My crooked example in action is here: viktoryatex.ru (when hovering over a product).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
monochromer, 2018-03-24
@yarhosting

The inspector shows that this code is incorrect. That is, for the delay, you need to explicitly specify the units of measurement -
0s

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question