home *** CD-ROM | disk | FTP | other *** search
/ Exame Informatica 139 / Exame Informatica 139.iso / Revista / Flash / Uniform Server / diskw / home / admin / www / js / scroller.js < prev   
Encoding:
JavaScript  |  2005-03-29  |  2.1 KB  |  58 lines

  1. /*
  2. ##########################################################
  3. # Name: The Uniform Server Admin Panel 2.0 Scroller JS 1.0
  4. # Developed By: The Uniform Server Development Team
  5. # Modified Last By: Olajide Olaolorun (empirex) 
  6. # Web: http://www.uniformserver.com
  7. ##########################################################
  8. */
  9.  
  10. // Page Scroller (aka custom scrollbar)- By Dynamic Drive
  11. // For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
  12. // This credit MUST stay intact for use
  13.  
  14. var Hoffset=70 //Enter buttons' offset from right edge of window (adjust depending on images width)
  15. var Voffset=80 //Enter buttons' offset from bottom edge of window (adjust depending on images height)
  16. var thespeed=3 //Enter scroll speed in integer (Advised: 1-3)
  17.  
  18. var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1
  19. var myspeed=0
  20.  
  21. var ieHoffset_extra=document.all? 15 : 0
  22. var cross_obj=document.all? document.all.staticbuttons : document.getElementById? document.getElementById("staticbuttons") : document.staticbuttons
  23.  
  24. function iecompattest(){
  25. return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  26. }
  27.  
  28. function positionit(){
  29. var dsocleft=document.all? iecompattest().scrollLeft : pageXOffset
  30. var dsoctop=document.all? iecompattest().scrollTop : pageYOffset
  31. var window_width=ieNOTopera? iecompattest().clientWidth+ieHoffset_extra : window.innerWidth+ieHoffset_extra
  32. var window_height=ieNOTopera? iecompattest().clientHeight : window.innerHeight
  33.  
  34. if (document.all||document.getElementById){
  35. cross_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-Hoffset+"px"
  36. cross_obj.style.top=dsoctop+parseInt(window_height)-Voffset+"px"
  37. }
  38. else if (document.layers){
  39. cross_obj.left=dsocleft+window_width-Hoffset
  40. cross_obj.top=dsoctop+window_height-Voffset
  41. }
  42. }
  43.  
  44. function scrollwindow(){
  45. window.scrollBy(0,myspeed)
  46. }
  47.  
  48. function initializeIT(){
  49. positionit()
  50. if (myspeed!=0){
  51. scrollwindow()
  52. }
  53. }
  54.  
  55. if (document.all||document.getElementById||document.layers)
  56. setInterval("initializeIT()",20)
  57.  
  58.