Skip to content

sharlag/Cat-Walk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cat Walk

Using JavaScript to move an animated cat across the screen.

<img style="position:absolute;" src="images/catwalk.gif">

<script>
  var img = document.getElementsByTagName('img')[0];
  //start position
  img.style.postion = 'absolute';
  img.style.left = '0px';

  function catWalk() {
    //distance traveled per frame
    img.style.left = parseInt(img.style.left) + 10 + 'px';
  }

  //speed
  window.setInterval(catWalk, 50);
</script>

About

Using JavaScript to move an animated cat across the screen.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages