home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / html / fix.js < prev    next >
Text File  |  2004-03-17  |  2KB  |  56 lines

  1. <!--
  2. function startFix(){
  3.  
  4.     fixedLAYER( 'fixedLay0' ,10,0)
  5.   }
  6.   //e4,e5,e6,n4,n6,n7,m1,o6,o7,s1ùp
  7.   function fixedLAYER(layName,offSetX,offSetY){
  8.  
  9.     if(!window.fixedLAYER[layName]){
  10.       this.ie    = !!document.all
  11.       this.n4    = !!document.layers
  12.       this.w3c   = !!document.getElementById
  13.       this.ua    = navigator.userAgent
  14.       this.mac45 = ua.indexOf('MSIE 4.5; Mac_PowerPC') != -1
  15.       this.mac5  = ua.indexOf('MSIE5.0;Mac_PowerPC')   != -1
  16.       this.macie = ua.indexOf('Mac_PowerPC')  !=-1 && ie
  17.       this.moz   = ua.indexOf('Gecko') !=-1
  18.       this.opr   = !!window.opera
  19.       if(this.ie&&!(this.mac45)){
  20.           window.onscroll = window.onresize = startFix
  21.       }
  22.       if(this.n4)
  23.         window.onresize = function(){ location.reload() }
  24.       window.fixedLAYER[layName] = true
  25.     }
  26.  
  27.     offSetX = parseInt(offSetX,10)
  28.     offSetY = parseInt(offSetY,10)
  29.     offLeft = offSetX
  30.     offTop  = offSetY
  31.  
  32.     if(document.all&&!this.opr){
  33.       var mx = document.body.scrollLeft + offLeft
  34.       var my = document.body.scrollTop  + offTop
  35.     } else {
  36.       var mx = self.pageXOffset + offLeft
  37.       var my = self.pageYOffset + offTop
  38.     }
  39.  
  40.     if(document.getElementById){
  41.         document.getElementById(layName).style.left = mx
  42.         document.getElementById(layName).style.top  = my
  43.     } else if(document.all){
  44.         document.all(layName).style.pixelLeft = mx
  45.         document.all(layName).style.pixelTop  = my
  46.     } else if(document.layers)   //n4ùp
  47.         document.layers[layName].moveTo(mx,my)
  48.  
  49.     if(!(this.ie&&!this.mac45) || this.opr){
  50.       clearTimeout(fixedLAYER[layName])
  51.       fixedLAYER[layName]=setTimeout("fixedLAYER('"+layName+"','"+posString
  52.                                      +"','" +offSetX+"','"+offSetY+"')",100)
  53.     }
  54.   }
  55.  // Original Script:(c) Toshirou Takahashi / Modified by Neo-Logue,Inc
  56. //-->