animate用法

點擊“滾開”,就會很明顯的看到animate用法

 

<head>

    <title></title>
    <style type="text/css">
    .spanclass{ position:relative; background:#ffdddd}
    .class1
    {
        background:#BCC7D8;
        }
    </style>
    <script src="jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('span:first').click(function () {
                $('span:eq(1)').animate({ left: '+=100px' }, 2000);
            })
        })
    </script>
</head>
<body>
<span class="class1">滾開</span><span class="spanclass">滾就滾</span>
</body>

發佈留言