Google News
logo
Anime.js - Interview Questions
What is the SEEK Control in Anime.js?
Jump to a specific time (in milliseconds).
animation.seek(timeStamp);
Can also be used to control an animation while scrolling.
animation.seek((scrollPercent / 100) * animation.duration);
Example : 
var animation = anime({
  targets: '.seek-anim-demo .el',
  translateX: 270,
  delay: function(el, i) { return i * 100; },
  elasticity: 200,
  easing: 'easeInOutSine',
  autoplay: false
});

var seekProgressEl = document.querySelector('.seek-anim-demo .progress');
seekProgressEl.oninput = function() {
  animation.seek(animation.duration * (seekProgressEl.value / 100));
};
Advertisement