Модель Arima с переменной xreg

Нет необходимости в тайм-ауте, используйте reflow для применения изменения:

function reset_animation() {
  var el = document.getElementById('animated');
  el.style.animation = 'none';
  el.offsetHeight; /* trigger reflow */
  el.style.animation = null; 
}
#animated {
  position: absolute;
  width: 50px; height: 50px;
  background-color: black;
  animation: bounce 3s ease-in-out infinite;
}
@keyframes bounce {
  0% { left: 0; }
  50% { left: calc( 100% - 50px ); }
  100% { left: 0; }
}
<div id="animated"></div>
<button onclick="reset_animation()">Reset</button>

0
задан Satpal Singh 21 January 2019 в 06:57
поделиться

0 ответов

Другие вопросы по тегам:

Похожие вопросы: