首页 > 代码库 > jquey实例之animate

jquey实例之animate

<!doctype html>
<html>
    <head>
        <meta charset="utf-8"/>
        <script type="text/javascript" src="http://www.mamicode.com/jquery.js"></script>
    </head>
      
    <body>
        <img src="http://www.mamicode.com/8fbf0884jw1drfmvfrhrhj.jpg" width="300" height="300"/>
        <button id="btn1">放大</button>
        <button id="btn2">缩小</button>
    </body>
</html>
        <script>
            $(function(){
                $(‘#btn1‘).click(function(){
                alert("11");
                    $(‘img‘).animate({width:1000,height:1000},500);
                });
                $(‘#btn2‘).click(function(){
                    $(‘img‘).animate({width:300,height:300},500);
                });
              
            });
        </script>


本文出自 “王尼美的成人之路” 博客,请务必保留此出处http://8335914.blog.51cto.com/8325914/1405769