实现广告在右边浮动
lastScrollY = 0;
function heartBeat() {
diffY = document.body.scrollTop;
percent = .1 * (diffY - lastScrollY);
if (percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
//right是浮动层的id
document.all.right.style.pixelTop += percent;
lastScrollY = lastScrollY + percent;
}
window.setInterval("heartBeat()", 1);
补充:web前端 , JavaScript ,