添加浮动广告

  1None.gif<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2None.gif<!-- saved from url=(0042)http://www.admin5.com/myjs/htm/data/js.htm -->
  3None.gif<HTML><HEAD><TITLE>JAVASCRIPT对象及属性</TITLE>
  4None.gif<META http-equiv=Content-Type content="text/html; charset=gb2312">
  5ExpandedBlockStart.gifContractedBlock.gif<STYLE>dot.gif{dot.gif}{
  6InBlock.gif    FONT: menu; LINE-HEIGHT: 150%
  7ExpandedBlockEnd.gif}

  8None.gif
</STYLE>
  9None.gif
 10None.gif<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
 11None.gif<BODY text=#000000 bgColor=#ffffff>
 12None.gif<TABLE width="100%" height="846" border=0 cellPadding=1 cellSpacing=4>
 13None.gif  <TBODY>
 14None.gif  <TR>
 15None.gif    <TD vAlign=top width=155 bgColor=#eeeeee>
 16None.gif      <DIV id=floater 
 17None.gif      style="Z-INDEX: 1; LEFT: 1%; WIDTH: 153px; POSITION: absolute; TOP: 10px; HEIGHT: 31px; background-color: #FF0000; layer-background-color: #FF0000; border: 1px none #000000;">  内容 
 18None.gif 
 19None.gif      <DIV id=floater1 
 20None.gif      style="Z-INDEX: 1; LEFT: 500%; WIDTH: 153px; POSITION: absolute; TOP: 0px; HEIGHT: 31px; background-color: #FF0000; layer-background-color: #FF0000; border: 1px none #000000;">  内容    </DIV>  </DIV>
 21ExpandedBlockStart.gifContractedBlock.gif            <SCRIPT language=JavaScript>dot.gif
 22InBlock.gif    self.onError=null;
 23InBlock.gif    currentX = currentY = 0
 24InBlock.gif    whichIt = null
 25InBlock.gif    lastScrollX = 0; lastScrollY = 0;
 26InBlock.gif    NS = (document.layers) ? 1 : 0;
 27InBlock.gif    IE = (document.all) ? 10;
 28InBlock.gif    <!-- STALKER CODE -->
 29ExpandedSubBlockStart.gifContractedSubBlock.gif    function heartBeat() dot.gif{
 30ExpandedSubBlockStart.gifContractedSubBlock.gif        if(IE) dot.gif{ diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
 31ExpandedSubBlockStart.gifContractedSubBlock.gif    if(NS) dot.gif{ diffY = self.pageYOffset; diffX = self.pageXOffset; }
 32ExpandedSubBlockStart.gifContractedSubBlock.gif        if(diffY != lastScrollY) dot.gif{
 33InBlock.gif    percent = .1 * (diffY - lastScrollY);
 34InBlock.gif    if(percent > 0) percent = Math.ceil(percent);
 35InBlock.gif    else percent = Math.floor(percent);
 36InBlock.gif                    if(IE) document.all.floater.style.pixelTop += percent;
 37InBlock.gif                    if(NS) document.floater.top += percent; 
 38InBlock.gif    lastScrollY = lastScrollY + percent;
 39ExpandedSubBlockEnd.gif    }

 40ExpandedSubBlockStart.gifContractedSubBlock.gif        if(diffX != lastScrollX) dot.gif{
 41InBlock.gif            percent = .1 * (diffX - lastScrollX);
 42InBlock.gif            if(percent > 0) percent = Math.ceil(percent);
 43InBlock.gif            else percent = Math.floor(percent);
 44InBlock.gif            if(IE) document.all.floater.style.pixelLeft += percent;
 45InBlock.gif            if(NS) document.floater.left += percent;
 46InBlock.gif            lastScrollX = lastScrollX + percent;
 47ExpandedSubBlockEnd.gif        }
    
 48ExpandedSubBlockEnd.gif    }

 49InBlock.gif    <!-- /STALKER CODE -->
 50InBlock.gif    <!-- DRAG DROP CODE -->
 51ExpandedSubBlockStart.gifContractedSubBlock.gif    function checkFocus(x,y) dot.gif
 52InBlock.gif    stalkerx = document.floater.pageX;
 53InBlock.gif    stalkery = document.floater.pageY;
 54InBlock.gif    stalkerwidth = document.floater.clip.width;
 55InBlock.gif    stalkerheight = document.floater.clip.height;
 56InBlock.gif    if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
 57InBlock.gif    else return false;
 58ExpandedSubBlockEnd.gif    }

 59ExpandedSubBlockStart.gifContractedSubBlock.gif    function grabIt(e) dot.gif{
 60ExpandedSubBlockStart.gifContractedSubBlock.gif        if(IE) dot.gif{
 61InBlock.gif            whichIt = event.srcElement;
 62ExpandedSubBlockStart.gifContractedSubBlock.gif            while (whichIt.id.indexOf("floater"== -1dot.gif{
 63InBlock.gif                whichIt = whichIt.parentElement;
 64ExpandedSubBlockStart.gifContractedSubBlock.gif                if (whichIt == nulldot.gifreturn true; }
 65ExpandedSubBlockEnd.gif        }

 66InBlock.gif            whichIt.style.pixelLeft = whichIt.offsetLeft;
 67InBlock.gif        whichIt.style.pixelTop = whichIt.offsetTop;
 68InBlock.gif            currentX = (event.clientX + document.body.scrollLeft);
 69InBlock.gif            currentY = (event.clientY + document.body.scrollTop);     
 70ExpandedSubBlockStart.gifContractedSubBlock.gif        }
 else dot.gif
 71InBlock.gif    window.captureEvents(Event.MOUSEMOVE);
 72ExpandedSubBlockStart.gifContractedSubBlock.gif    if(checkFocus (e.pageX,e.pageY)) dot.gif
 73InBlock.gif    whichIt = document.floater;
 74InBlock.gif    StalkerTouchedX = e.pageX-document.floater.pageX;
 75InBlock.gif    StalkerTouchedY = e.pageY-document.floater.pageY;
 76ExpandedSubBlockEnd.gif    }
 
 77ExpandedSubBlockEnd.gif        }

 78InBlock.gif    return true;
 79ExpandedSubBlockEnd.gif    }

 80ExpandedSubBlockStart.gifContractedSubBlock.gif    function moveIt(e) dot.gif{
 81ExpandedSubBlockStart.gifContractedSubBlock.gif        if (whichIt == nulldot.gifreturn false; }
 82ExpandedSubBlockStart.gifContractedSubBlock.gif        if(IE) dot.gif{
 83InBlock.gif        newX = (event.clientX + document.body.scrollLeft);
 84InBlock.gif        newY = (event.clientY + document.body.scrollTop);
 85InBlock.gif        distanceX = (newX - currentX); distanceY = (newY - currentY);
 86InBlock.gif        currentX = newX; currentY = newY;
 87InBlock.gif        whichIt.style.pixelLeft += distanceX;
 88InBlock.gif        whichIt.style.pixelTop += distanceY;
 89InBlock.gif            if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
 90InBlock.gif            if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
 91InBlock.gif            if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
 92InBlock.gif            if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
 93InBlock.gif            event.returnValue = false;
 94ExpandedSubBlockStart.gifContractedSubBlock.gif        }
 else dot.gif
 95InBlock.gif            whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
 96InBlock.gif    if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
 97InBlock.gif    if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
 98InBlock.gif    if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
 99InBlock.gif    if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
100InBlock.gif    return false;
101ExpandedSubBlockEnd.gif        }

102InBlock.gif    return false;
103ExpandedSubBlockEnd.gif    }

104ExpandedSubBlockStart.gifContractedSubBlock.gif    function dropIt() dot.gif{
105InBlock.gif        whichIt = null;
106InBlock.gif    if(NS) window.releaseEvents (Event.MOUSEMOVE);
107InBlock.gif    return true;
108ExpandedSubBlockEnd.gif    }

109InBlock.gif    <!-- DRAG DROP CODE -->
110ExpandedSubBlockStart.gifContractedSubBlock.gif    if(NS) dot.gif{
111InBlock.gif        window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
112InBlock.gif        window.onmousedown = grabIt;
113InBlock.gif        window.onmousemove = moveIt;
114InBlock.gif        window.onmouseup = dropIt;
115ExpandedSubBlockEnd.gif    }

116ExpandedSubBlockStart.gifContractedSubBlock.gif    if(IE) dot.gif{
117InBlock.gif        document.onmousedown = grabIt;
118InBlock.gif        document.onmousemove = moveIt;
119InBlock.gif        document.onmouseup = dropIt;
120ExpandedSubBlockEnd.gif    }

121ExpandedBlockEnd.gif    if(NS || IE) action = window.setInterval("heartBeat()",1);
122None.gif
</SCRIPT>
123None.gif
124None.gif    </TD>  
125None.gif<TD><FONT face="Geneva, Arial, Helvetica, san-serif" size=3><B><FONT 
126None.gifcolor=#990000 size=7></P></TD></TR></TBODY></TABLE></BODY></HTML>
127None.gif

转载于:https://www.cnblogs.com/fengxiaoxiao/archive/2006/12/30/608105.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值