主题:  这段代码是干什么的?

透明男孩

职务:普通成员
等级:2
金币:0.0
发贴:373
注册:2001/8/7 7:32:48
#12003/10/13 20:14:21
在一个ASP文件里有一个空图层,后面还链接了一个JS文件,不明白是干什么,请各位解释一下.
层:
style="Z-INDEX: 20; WIDTH: 130px; POSITION: absolute; TOP: 342px; overflow: visible;; left: 2px">

js:
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
function heartBeat() {
    if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
    if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
    if(diffY != lastScrollY) {
    percent = .1 * (diffY - lastScrollY);
    if(percent > 0) percent = Math.ceil(percent);
     else percent = Math.floor(percent);
            if(IE) document.all.floater.style.pixelTop += percent;
            if(NS) document.floater.top += percent;
     lastScrollY = lastScrollY + percent;
    }
    
    }
    function checkFocus(x,y) {
     stalkerx = document.floater.pageX;
     stalkery = document.floater.pageY;
     stalkerwidth = document.floater.clip.width;
     stalkerheight = document.floater.clip.height;
     if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
     else return false;
    }
    function grabIt(e) {
        if(IE) {
        whichIt = event.srcElement;
        while (whichIt.id.indexOf("floater") == -1) {
            whichIt = whichIt.parentElement;
            if (whichIt == null) { return true; }
        }

        whichIt.style.pixelTop = whichIt.offsetTop;
             currentY = (event.clientY + document.body.scrollTop);     
        }
     if(checkFocus (e.pageX,e.pageY)) {
     whichIt = document.floater;
     StalkerTouchedX = e.pageX-document.floater.pageX;
     StalkerTouchedY = e.pageY-document.floater.pageY;
     } else {
     window.captureEvents(Event.MOUSEMOVE);
        }
     return true;
}
document.onmousedown = "grabIt";
action = window.setInterval("heartBeat()",1);



7877767

职务:普通成员
等级:2
金币:1.0
发贴:528
注册:2002/2/19 0:11:31
#22003/10/14 18:10:49
也许拿来做晃来晃去的广告条



透明男孩

职务:普通成员
等级:2
金币:0.0
发贴:373
注册:2001/8/7 7:32:48
#32003/10/15 19:13:43
不是吧.
那是个空层呀.