D
D
DrunkMaster2018-02-16 19:35:32
JavaScript
DrunkMaster, 2018-02-16 19:35:32

How to make smoothly in native JS?

How is this action

document.getElementById('id').style.display='none';

make it smooth, because the page now jerks sharply when the block on it disappears ... Without JQ, of course! ))

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Tsvetkov, 2018-02-16
@yellow79

https://learn.javascript.ru/js-animation

S
Stimulate, 2018-02-16
@Stimulate

as an option to make the interval more transparent and more transparent

N
Nikolai Chuprik, 2018-02-16
@choupa

document.getElementById('id').classList.add('hidden');

CSS:
.hidden  {
  opacity: 0;
  transition: 1s;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question