码迷,mamicode.com
首页 > 其他好文 > 详细

含倒计时的爆炸特效

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

标签:on()   head   倒计时   hid   text   margin   span   javascrip   src   

<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>

含倒计时的爆炸特效

标签:on()   head   倒计时   hid   text   margin   span   javascrip   src   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!