w3c声明下可运行 兼容性比较好的js对联广告集合

  lastScrollY=0;

  function heartBeat(){

  var diffY;

  if (document.documentElement && document.documentElement.scrollTop)

  diffY = document.documentElement.scrollTop;

  else if (document.body)

  diffY = document.body.scrollTop

  else

  {/*Netscape stuff*/}

  //alert(diffY);

  percent=.1*(diffY-lastScrollY);

  if(percent>0)percent=Math.ceil(percent);

  else percent=Math.floor(percent);

  document.getElementById("leftDIV").style.top=parseInt(document.getElementById("leftDIV").style.top)+percent+"px";

  document.getElementById("rightDIV").style.top=parseInt(document.getElementById("leftDIV").style.top)+percent+"px";

  lastScrollY=lastScrollY+percent;

  //alert(lastScrollY);

  }

  sidebar1= "

"

  sidebar2= "

"

  document.write(sidebar1);

  document.write(sidebar2);

  //下面这段删除后,对联将不跟随屏幕而移动。

  window.setInterval("heartBeat()",1);

  //-->

  function closeAD()

  {

  document.getElementById("leftDIV").style.display='none';

  document.getElementById("rightDIV").style.display='none';

  }