复制代码代码如下:
<Script Language = "JavaScript" type = "text/javascript">
lastScrolly = 0;
função Heartbeat () {
var diffy;
if (document.documentElement && document.documentElement.scrolltop)
diffy = document.documentElement.scrolltop;
caso contrário, se (document.body)
diffy = document.body.scrolltop
outro
{/*Netscape Stuff*/}
// alerta (diffy);
porcentagem = 0,1*(diffy-lastscrolly);
if (porcentagem> 0) por cento = math.ceil (porcentagem);
else porcent = math.floor (porcentagem);
document.getElementById ("ad_left"). style.top = parseint (document.getElementById
("ad_left"). style.top)+porcentagem+"px";
document.getElementById ("ad_right"). style.top = parseint (document.getElementById
("ad_left"). style.top)+porcentagem+"px";
lastScrolly = lastScrolly+por cento;
// alerta (por último);
}
função hidead (num)
{
showad = false;
if (num == 1)
document.getElementById ("ad_left"). style.display = "nenhum";
caso contrário, se (num == 2)
document.getElementById ("ad_right"). style.display = "nenhum";
}
var closeButtonHtml1 = '<div style = "Posição: Absoluto; inferior: 0px; direita: 25px; margem: 2px; preenchimento: 2px; z-index: 2000;"> <a href = "JavaScript: void (0);" OnClick = "Hidead (1)" Style = "Cor: #ffffff; Text-Decoration: Nenhum; font-size: 12px;"> 关闭 </a> </div> ';
var closeButtonHtml2 = '<div Style = "Posição: Absoluto; inferior: 0px; direita: 25px; margem: 2px; preenchimento: 2px; z-index: 2000;"> <a href = "JavaScript: void (1);" OnClick = "Hidead (2)" style = "cor: #ffffff; text-decoração: nenhum; font-size: 12px;"> 关闭 </a> </div> ';
ad1 = "<div id =/" ad_left/"style = 'direita: 10px; posição: absoluto; topo: 160px;'> </div>"
ad2 = "<div id =/" ad_right/"style = 'direita: 10px; posição: absoluto; topo: 160px;'> <br> <a href = 'tencent: // message/? uin = 758541860 & menu = sim' > <img altura = '120' src = '../imagens/qq.gif' border = '0' width = '110'> </a> </div> ";
document.write (ad1);
document.write (ad2);
window.setInterval ("Heartbeat ()", 1);
</script>