广告定时关闭
添加广告定时关闭:
方法一:
添加广告,绑定广告版位;
在模板中调用广告标签时,需添加以下代码:
<script>
function changcount(){
document.getElementById("pic").style.visibility="hidden";
}
setTimeout("changcount()",5000);--5000:关闭时间---
</script>
<div id="pic">
---这行填写调用广告标签---
<div>
方法二:
在模板中调用广告标签时,需添加以下代码:
在CSS中添加:
#pic {
-moz-animation: cssAnimation 0s ease-in 5s forwards;
/* Firefox;5s:关闭时间 */
-webkit-animation: cssAnimation 0s ease-in 5s forwards;
/* Safari and Chrome */
-o-animation: cssAnimation 0s ease-in 5s forwards;
/* Opera */
animation: cssAnimation 0s ease-in 5s forwards;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
@-webkit-keyframes cssAnimation {
to {
width:0;
height:0;
overflow:hidden;
}
}
模板中:
<div id="pic">
---这行填写调用广告标签---
<div>