Answers for "how to make a animation in javascript stack overflow"

0

how to make a animation in javascript stack overflow

function myMove() {
  var elem = document.getElementById("animate");
  var pos = 0;
  var id = setInterval(frame, 5);
  function frame() {
    if (pos == 350) {
      clearInterval(id);
    } else {
      pos++;
      elem.style.top = pos + 'px';
      elem.style.left = pos + 'px';
    }
  }
}
Posted by: Guest on May-10-2020

Code answers related to "how to make a animation in javascript stack overflow"

Code answers related to "Javascript"

Browse Popular Code Answers by Language