0
点赞
收藏
分享

微信扫一扫

jq之animate()队列

墨春 2022-01-13 阅读 86
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jq之demo</title>
    <!--线上jq库-->
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <script>
        $(document).ready(function(){
            $("button").click(function(){
                /*动画*/
                var div=$("div");
                    div.animate({height:'300px',opacity:'0.4'});
                    div.animate({width:'300px',opacity:'0.8'});
                    div.animate({height:'50px',opacity:'0.4'});
                    div.animate({width:'50px',opacity:'0.8'});
            });
        });
    </script>
</head>
<body>
<button>开始</button>
<p>html元素想要移动把position设为relative,fixed或absolute</p>
<div style="background: aqua;height: 50px;width: 50px;"></div>
</html>
举报

相关推荐

0 条评论