(062)jquery_动画_animate2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>animate_animate1.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> <style type="text/css"> span { position:absolute; width:80px; height:80px; border: solid 1px #ccc; margin: 0px 8px; background-color: red; color:white; vertical-align:middle } </style> <script type="text/javascript" src="../js/jquery/jquery190.js"></script> <script type="text/javascript"> $(function(){ $("span").animate({ left:"+100px" },3000,function(){ $(this).animate({ width:"300px", height:"300px" },3000,function(){ $("tip").html("动画执行完成"); }); }); }); </script> </head> <body> <h3>制作简单的动画效果</h3> <span></span> <div id="tip"></div> </body> </html>
调用animate()方法不仅可以制作简单渐渐变大的动画效果,而且还能制作移动位置的动画,在移动位置之前,必须将被移元素的“position”属性值设为“absolute”或“relative”,否则,该元素移动不了。
***万事万物都有裂痕,那是光照进来的地方***

浙公网安备 33010602011771号