javascript - How to use Jquery to achieve the animation effect of opening the animation from the middle to the upper and lower sides. Thank you, masters!
巴扎黑
巴扎黑 2017-05-19 10:38:21
0
1
656
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<style>
    *{margin:0;padding:0}
    .view{width: 200px;height:0;margin:0 auto;background: #000;display:none}
    .hit{display: block;margin: 0 auto}
</style>
<body>
<p class="view">asddddddddddd</p>
<button class="hit">点击</button>
</body>
<script>
    $(".hit").on("click",function(){
       $(".view").animate({height:"200px"},2000)
               .css("display","block")
    })
</script>
</html>
巴扎黑
巴扎黑

reply all(1)
我想大声告诉你
$(".hit").on("click",function(){
    
   $(".view").css({position:"relative",top:"100px",height:"0"}).animate({height:"200px",top:0},2000)
           .css("display","block")
})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template