jquery做简单的动画效果

来源:互联网 发布:vm12安装mac os win10 编辑:程序博客网 时间:2024/04/29 23:14

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="动画.aspx.cs" Inherits="JQuery.动画" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
              #img2
        {
            width:200px;
            height:150px;
           
        }
        #div2
        {
            width:200px;
            height:150px;
            position:relative;
        }
    </style>
    <script src="script/jquery-1.10.2.js"></script>
    <script type="text/javascript">
        $(function () {
                      $("#div2").hover(function () {
               $(this).animate({ left: '500px', top: '500px' }, 3000);
               $(this).animate({ left: '0px', top: '0px' }, 3000);
           }, function () { $(this).stop(); });
        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>                   
            <div id="div2"><img src="image/ee.jpg" id="img2"/></div>
    </div>
    </form>
</body>
</html>

0 0
原创粉丝点击