<div class="sticker" id="stiker"></div>
.sticker {
position: relative;
height: 80px;
width: 80px;
background: url(https://2.bp.blogspot.com/-BBx70tsKzTQ/WKuUWrml-lI/AAAAAAAAEFk/EhAj_uISOV85dK1GHt1TuikfN2zAC9kVACPcB/s1600/burung.png);
background-size: 320px 320px;
cursor: default;
background-position: 0px 0px;
image-rendering: -webkit-optimize-contrast;
}
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);
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.