标签:文档 art sdn center tle style 分享 回调函数 效果
回调函数:动画运行结束后要运行的函数
html代码:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-2.1.4/jquery.min.js" language="javascript"></script>
</head>
<body>
<div id="div1" style="width:200px; height:100px; background-color:#999999; position:absolute" onclick="f1()"></div>
</body>
<script>
function f1(){
<span style="white-space:pre"> </span>//距离左 50%。距离上 300px 结果:斜下移动
$("#div1").animate({"left":"50%","top":"300px"},3000,function(){
alert("动画完毕");
});
}
</script>
</html>
标签:文档 art sdn center tle style 分享 回调函数 效果
原文地址:http://www.cnblogs.com/clnchanpin/p/7082104.html