Skip to content

Instantly share code, notes, and snippets.

@ardianta
Created February 21, 2017 01:15
Show Gist options
  • Select an option

  • Save ardianta/abb5cf78e609202e614c34cc6fa6bad9 to your computer and use it in GitHub Desktop.

Select an option

Save ardianta/abb5cf78e609202e614c34cc6fa6bad9 to your computer and use it in GitHub Desktop.
var x = 0;
var y = 0;
setInterval(function(){
x -= 80
if( x == -320){
x = 0;
y -= 80;
} else {
if(y == -240)
{
y = 0;
}
}
document.getElementById('stiker').style.backgroundPositionX = String(x) + "px";
document.getElementById('stiker').style.backgroundPositionY = String(y) + "px";
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment