Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
  
  
  
  <div id="bird"></div>
  <img src="http://media.bestofmicro.com/,D-S-308944-3.jpg" />
  
  
  
</body>
</html>
 
#bird{
  position:absolute;
  z-index:2;
  height:200px;
  width:250px;
  background: url("http://www.kadrmasconcepts.com/blog/wp-content/uploads/2011/05/robin.png") 0 -360px;
  
}
 
var c = 0 ;
function loop(){
  c = ++c%5;
  $('#bird').css({backgroundPosition: (240*c)+'px -330px'});
}
setInterval(loop, 25);
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers