U
U
uRoot2019-05-12 22:16:59
css
uRoot, 2019-05-12 22:16:59

How to make animation on loss of focus?

There is the following construction: sandbox
With hoverdiv , the submenu changes from to and the animation is triggered:display: none;display: block;

animation: slide-top 0.3s ease-in-out both;
@keyframes slide-top {
    0% {
       transform: translateY(30px);
       opacity: 0;
    }
    100% {
       transform: translateY(0);
       opacity: 1;
       }
    }

But it only works on hover, but not on loss of focus, how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy Pershin, 2019-05-12
@uroot

With display: none; you will not do reverse animation, but with visibility: hidden; and transition is easy to repeat:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question