home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / internet / archeo / reportaze / scrollbar.js < prev   
Text File  |  2001-10-02  |  2KB  |  54 lines

  1. if (iens6){
  2. var crossobj=document.getElementById? document.getElementById("content") : document.all.content
  3. var contentheight=crossobj.offsetHeight
  4. }
  5. else if (ns4){
  6. var crossobj=document.nscontainer.document.nscontent
  7. var contentheight=crossobj.clip.height
  8. }
  9.  
  10. scShift=(400-54)/(contentheight/speed);
  11. scShift=Math.floor(scShift);
  12.  
  13. function movedown()
  14. {
  15.     if (parseInt(document.getElementById('scrol').style.top)<384-54)
  16.     {
  17.         document.getElementById('scrol').style.top=parseInt(document.getElementById('scrol').style.top)+scShift;
  18.     }
  19.     if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
  20.         crossobj.style.top=parseInt(crossobj.style.top)-speed
  21.     else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
  22.         crossobj.top-=speed
  23.     movedownvar=setTimeout("movedown()",100)
  24. }
  25.  
  26. function moveup()
  27. {
  28.     if (parseInt(document.getElementById('scrol').style.top)>16)
  29.     {
  30.         document.getElementById('scrol').style.top=parseInt(document.getElementById('scrol').style.top)-scShift;
  31.     }
  32.     if (iens6&&parseInt(crossobj.style.top)<=0)
  33.         crossobj.style.top=parseInt(crossobj.style.top)+speed
  34.     else if (ns4&&crossobj.top<=0)
  35.         crossobj.top+=speed
  36.     moveupvar=setTimeout("moveup()",100)
  37. }
  38.  
  39. function moveDownBySC()
  40. {    
  41.     event.clientY
  42.     if (iens6&&parseInt(crossobj.style.top)<=0)
  43.         crossobj.style.top=parseInt(crossobj.style.top)+speed
  44. }
  45.  
  46. function getcontent_height(){
  47. if (iens6)
  48. contentheight=crossobj.offsetHeight
  49. else if (ns4)
  50. document.nscontainer.document.nscontent.visibility="show"
  51. }
  52. window.onload=getcontent_height
  53.  
  54.