首页 > 其他 > 详细

含倒计时的爆炸特效

时间:2017-08-20 00:34:45      阅读:303      评论:0      收藏:0      [点我收藏+]

<style>
.content{
width: 500px;
margin:0 auto;
}


.content .img1{
animation: zhazha 1s infinite;
}


.content .img2 {
animation: boom 1s 1;
}


@keyframes zhazha{
from{
                transform: scale(0.8);
}to{
                transform: scale(1.1);
}
}


@keyframes boom{
from{
                transform: scale(0);
}to{
    transform: scale(1);
  }
}


</style>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/boom.js"></script>
</head>
<body>
<input type="button" class="btn" value="炸了炸了" />
<div class="content">
<p class="boom"></p>
    <img class="img1" src="img/boom.jpg"/>
    <img class="img2" src="img/booms.jpg"/>

</div> 

 

<script>

$(function(){


$(".content").hide();


$(".btn").click(function(){
var time=3;


var set=setInterval(function(){
if(time>0){
$(".boom").text(time-- +"s");
$(".content").show();
$(".content .img2").hide();
}else{
$(".content .img1,p").hide();
$(".content .img2").show();
}
},1000);
})
})

 

</script>

含倒计时的爆炸特效

原文:http://www.cnblogs.com/cutenana/p/7398327.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!