js 自動隱藏的導航欄

 

  1. <SCRIPT language=JavaScript1.2>   
  2.    
  3. function move(x, y) {  
  4. if (document.all) {  
  5. object1.style.pixelLeft += x;  
  6. object1.style.pixelTop  += y;}  
  7. else 
  8. if (document.layers) {  
  9. document.object1.left += x;  
  10. document.object1.top  += y;  
  11. }};  
  12.    
  13. function position() {  
  14. document.object1.left += -82;  
  15. document.object1.top  += 0;  
  16. document.object1.visibility = "show" 
  17. };  
  18.    
  19. function makeStatic() {  
  20. if (document.all) {object1.style.pixelTop=document.body.scrollTop+20}  
  21. else {eval('document.object1.top=eval(window.pageYOffset+20)');}  
  22. setTimeout("makeStatic()",0);}  
  23.    
  24. </SCRIPT>  
  25.    
  26. <STYLE type=text/css>.hl {  
  27.  BACKGROUND-COLOR: green; COLOR: white; CURSOR: hand  
  28. }  
  29. .n {  
  30.    
  31. }  
  32. </STYLE>  
  33.    
  34.    
  35. <LAYER class=NS onmouseout="move(-132, 0)" 
  36. onmouseover="move(132, 0)" left="0" bgcolor="black" name="object1" top="20" 
  37. visibility="hide">  
  38. <SCRIPT language=JavaScript1.2>   
  39. if (document.all)  
  40. document.write('<DIV ID="object1" style="Position : Absolute ;Left : -82px ;Top : 20px ;Width : 0px ;Z-Index : 20">')  
  41. </SCRIPT>  
  42.    
  43. <TABLE border=0 cellPadding=2 cellSpacing=1  
  44. onmouseout="move(-82, 0)"   
  45.   <TBODY>  
  46.   <TR>  
  47.     <TD bgColor=#aec9e5><FONT face=宋體 size=3><B>導航菜單</B></FONT></TD>  
  48.     <TD align=middle rowSpan=100 width=12>  
  49.       <SCRIPT language=JavaScript1.2>   
  50. if (document.all||document.layers)  
  51. document.write("<img src='menui.gif'>")  
  52. </SCRIPT>  
  53.     </TD></TR>  
  54.   <SCRIPT language=JavaScript1.2>  
  55. <!--  
  56. if (document.all||document.layers)  
  57. makeStatic();  
  58.    
  59. if (document.layers) {  
  60. window.  
  61. }  
  62.    
  63. var sitems=new Array();  
  64. var sitemlinks=new Array();  
  65.    
  66. // 修改這裏  
  67.    
  68. sitems[0]="盼盼家園";  
  69. sitems[1]="盼盼分站";  
  70. sitems[2]="便民服務";  
  71. sitems[3]="精品論壇";  
  72. sitems[4]="html轉js";  
  73. sitems[5]="歷史今天";  
  74. sitems[6]="盼盼家園";  
  75. sitems[7]="盼盼家園";  
  76. sitems[8]="盼盼家園";  
  77. sitems[9]="盼盼家園";  
  78. sitems[10]="盼盼家園";  
  79. sitems[11]="盼盼家園";  
  80. sitems[12]="盼盼家園";  
  81. sitems[13]="盼盼家園";  
  82.    
  83. sitemlinks[0]="http://www.panpan.org";  
  84. sitemlinks[1]="http://www1.panpan.org";  
  85. sitemlinks[2]="http://cha.panpan.org";  
  86. sitemlinks[3]="http://bbs.panpan.org";  
  87. sitemlinks[4]="http://http://cha.panpan.org/Tools/Master/Htm_js.asp";  
  88. sitemlinks[5]="http://www.panpan.org/today";  
  89. sitemlinks[6]="http://www.panpan.org";  
  90. sitemlinks[7]="http://www.panpan.org";  
  91. sitemlinks[8]="http://www.panpan.org";  
  92. sitemlinks[9]="http://www.panpan.org";  
  93. sitemlinks[10]="http://www.panpan.org";  
  94. sitemlinks[11]="http://www.panpan.org";  
  95. sitemlinks[12]="http://www.panpan.org";  
  96. sitemlinks[13]="http://www.panpan.org";  
  97.    
  98. for (i=0;i<=sitems.length-1;i++)  
  99. if (document.all) {document.write('<TR><TD bgcolor=orange onclick="location=\''+sitemlinks[i]+'\'" onmouseover="className=\'hl\'" onmouseout="className=\'n\'"><FONT SIZE=2>'+sitems[i]+'</FONT></TD></TR>')}  
  100. else if (document.layers){document.write('<TR><TD bgcolor="orange"><FONT SIZE=2><A HREF="'+sitemlinks[i]+'">'+sitems[i]+'</A></FONT></TD></TR>')}  
  101.    
  102. function hl(n) {  
  103. n.className='hl'}  
  104. function n(h) {  
  105. h.className='n'}  
  106. //--></SCRIPT>  
  107.   </TBODY></TABLE>  
  108. <SCRIPT language=JavaScript1.2>   
  109. if (document.all)  
  110. document.write('<\/DIV>')  
  111. </SCRIPT>  
  112. </LAYER>  

導航欄用的圖片在附件中.

也可以自己製作一個新圖片

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章