<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>炫酷粒子变换特效</title>
<style type="text/css">
body,html{
margin:0px;
height:100%;
}
body{background: #000;
overflow: hidden;}
div{ width:200px;
height:200px;
border: 5px #fff solid;
border-radius: 50%;
position: relative;
margin: 0 auto;
text-align: center;
-webkit-transition: all .5s ease-in .1s;
top: 50%;
left: 50%;
margin-left: -100px;
margin-top: -100px;
}
div>span{ color: #fff;
display: inline-block;
position: absolute;
left: 50%;
top: 50%;
font-size: 145px;
line-height: 74%;
font-weight: bolder;
font-family: Arial, Helvetica, sans-serif;
-webkit-transform: translate(-50%, -50%);
width: 100%;
}
.bigbang{
-webkit-transform: scale(10);
opacity: 0;
}
</style>
</head>
<body>
<div>
<span id="num">20</span>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
function djs(){
var obj=document.getElementById('num');
var num=obj.innerText;
obj.innerText=num-1;
if(num-1==0){
clearInterval(ds);
obj.parentElement.className='bigbang';
setTimeout(function(){
obj.parentElement.className='';
obj.innerHTML='时间到';
obj.style.fontSize='58px';
obj.parentElement.style.background='red';
},600)
}
}
//djs();
var ds=setInterval(djs,1000);
</script>
</body>
</html>