<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>挑战题</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
<style>
#tip{width:100px;height:100px;background:orange;top:50px;left:140px;position:absolute;}
</style>
</head>
<body>
<button id="left">左移</button>
<button id="right">右移</button>
<div id="tip">0</div>
<script type="text/javascript">
$(function() {
$("#left").bind("click", function() {
$("#tip").animate({
left: "-=50px"
}, 2000)
}
);
$("#right").bind("click", function() {
$("#tip").animate({
left: "+=50px"
}, 2000);
})
})
</script>
</body>
</html>