分享

含倒计时的爆炸特效代码

 昵称47052376 2017-09-05
含倒计时的爆炸特效代码:

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

原作者:辣子倩

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多