1 回答

TA贡献1828条经验 获得超6个赞
jQuery实现很简单啊,写了个demo给你
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="//localhost/jquery-3.1.0.min.js"></script>
<style>
.wrap { position: relative; width: 500px; height: 500px; background-color: #eee; }
.wrap div{ position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); -webkit-transform: translate(-50%,-50%); -ms-transform: translate(-50%,-50%); width: 0px; height: 0px; background-color: red; }
</style>
</head>
<body>
<div class="wrap">
<div></div>
</div>
</body>
<script>
$(function(){
$('.wrap div').animate({height:'500px', width:'500px'},2000);
})
</script>
</html>
添加回答
举报