首页 > Web开发 > 详细

jQuery学习-自定义动画

时间:2016-11-17 13:58:54      阅读:142      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>自定义动画</title>
        <script src="js/jquery.js"></script>
    
        <style>
        .me1{ 
            position: absolute;
            left: 20%;
            top: 50%;
            margin-left: -150px;
            margin-top: -75;
            width: 400px;
            height: 100px;
            background-color: orange;
            overflow: auto;
            padding: 10px;
            border: 30px solid lightblue;
            
        }
        
        .me2{ 
            position: absolute;
            left: 70%;
            top: 50%;
            margin-left: -200px;
            margin-top: -75;
            width: 400px;
            height: 100px;
            background-color: blue;
            overflow: auto;
            padding: 10px;
            border: 30px solid orange;
            
        }
    
        </style>
        <script type="text/javascript">    
            //页面加载完成简写形式
            $(function(){
                //animate 第一参数 目标值 第二个参数持续时间  
            $(".me1").animate({left:"60%",top:"80%",width:"5%",height:"5%",borderWidth:"1px"},
                              {queue:true, duration: 1000} //queue使用队列动画
                              )
            $(".me1").animate({left:"20%",top:"50%",width:"20%",height:"20%",borderWidth:"30px"},
                              {queue:true, duration: 1000} //queue使用队列动画
                              )
            })
        
        </script>
    </head>
    <body>
        <div class="me1"></div>
        <div class="me2"></div>
    </body>
</html>

 

jQuery学习-自定义动画

原文:http://www.cnblogs.com/whzym111/p/6073066.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!