image.png
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style media="screen">
* {
margin: 0;
padding: 0;
}
#box {
width: 500px;
height: 100px;
background-color: #ea6f5a;
position: relative;
border-radius: 50px;
left: 200px;
top: 200px;
overflow: hidden;
}
.yuan {
width: 2px;
height: 2px;
background-color: #fff;
position: absolute;
left: 50%;
top: 50%;
border-radius: 1px;
margin-left: -1px;
margin-top: -1px;
}
</style>
</head>
<body>
<div id="box">
<div class="yuan"></div>
</div>
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript">
var $yuan = $('.yuan');
var $box = $('#box');
setInterval(function() {
$yuan.animate({
'width': 500,
'height': 500,
'borderRadius': 250,
'marginLeft': -250,
'marginTop': -250,
'opacity': 0
}, 1000, function() {
$(this).css({
'width': 2,
'height': 2,
'borderRadius': 1,
'marginLeft': -1,
'marginTop': -1,
'opacity': 1
});
})
}, 1000)
</script>
</body>
</html>