(062)jquery_动画_stop

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>animate_stop.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">
        div
        {
            margin: 10px 0px;
        }
        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:"250px",height:"250px"},3000,function(){
                    $("#tip").html("动画执行完成");
                });
            });
            
            $("#btnStop").bind("click",function(){
                $("span").stop();
                $("#tip").html("动画停止");
            });
        });
    </script>
  </head>
  
  <body>
        <h3>调用stop()方法停止当前所有动画效果</h3>
        <span></span>
        <input id="btnStop" type="button" value="停止" />
        <div id="tip"></div>
  </body>
</html>

 

posted @ 2014-12-30 16:13  雪中飞雁  阅读(63)  评论(0)    收藏  举报