<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>animate最简单动画</title>
<style type="text/css">
*{ margin:0px; padding:0px; font-size:12px;}
body {
background-color: #930;
}
</style>
<script language="javascript" src="jquery-1.7.1.min.js"></script>
<script language="javascript">
$(function(){
$("#btn").click(function(){
$("#box").animate({left: 250, opacity: 'hide'}, 500);
})
})
</script>
</head>
<body>
<div style="width:1000px; height:500px; position:relative; margin:20px auto; background:#fff;">
<div style="width:150px; height:200px; background:#999; position:absolute; left:20px; top:60px;" id="box">动画移动块</div>
<div style="width:100px; height:30px; line-height:30px; text-align:center; background:#006; color:#fff;" id="btn">btn移动</div>
</div>
</body>
</html>
转载于:https://my.oschina.net/u/583531/blog/309869