コードコピーは次のとおりです。
<script type = "text/javascript">
var time = 300;
var h = 0;
関数addcount()
{
if(time> 0)
{
時間 - ;
H = H+5;
}
それ以外
{
戻る;
}
if(h> 300)// height
{
戻る;
}
document.getElementById( "ads")。style.display = "";
document.getElementById( "ads")。style.height = h+"px";
setimeout( "addcount()"、30);
}
window.onload = function showads()
{
addcount();
setimeout( "noneads()"、7000); //滞在時間を自分で調整しました
}
var t = 300;
var n = 300; //身長
function noneads()
{
if(t> 0)
{
t--;
n = n-5;
}
それ以外
{
戻る;
}
if(n <0)
{
document.getElementById( "ads")。style.display = "none";
戻る;
}
document.getElementById( "ads")。style.height= n+"px";
setimeout( "noneads()"、30);
}
</script>
コードコピーは次のとおりです。
<div style = "マージン:0px auto; width:900px; background:#369; height:300px; color:#fff" id = "ads"> wulin.com_www.vevb.com </div>