javascript实现网站顶部出现几秒后图片缓慢消失的效果 时间:2020-05-12 人气:0 www.qb5200.com <script language="javascript" type="text/javascript"> window.onload = function(){ var fudongAD = document.getElementById("headads"); setTimeout("noneheadads()", 3000); //停留时间自己适当调整 } var height2 = 339; //高度 function noneheadads() { height2 = height2 - 10; if (height2 <= 0) { document.getElementById("headads").style.display = "none"; return; } document.getElementById("headads").style.height = height2 + "px"; setTimeout("noneheadads()", 40); } </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容