<html>
<head>
<title>jQuery backgroundPosition Animation</title>
<script src="jquery-latest.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#btn1").click(function(){
$("div").animate({
backgroundPositionX: "+=80px",
backgroundPositionY: "+=80px"
});
});
$("#btn2").click(function(){
$("div").animate({
backgroundPositionX: "0px",
backgroundPositionY: "0px"
});
});
});
</script>
<style>
div {
width: 100%;
height: 100%;
background-repeat:no-repeat;
position:fixed;
}
</style>
</head>
<body>
<button id="btn1">Animate Start</button>
<button id="btn2">Animate Stop</button>
<div style="background-image:url('../../images/img_nat.png');"></div>
</body>
</html>