中文(繁体)
<!-- 把以下程式碼加入<body>區域 --> <!-- web http://www.downcodes.com --> <!-- bbs http://www.downcodes.com/bbs- -> <style rel=stylesheet type=text/css> BODY { BORDER-BOTTOM: 0px;左邊框:0px;右邊框:0px;頂部邊框:0px;邊距:0 像素;顏色:buttontext } #menu { 背景:buttonface; BORDER-BOTTOM:按鈕面 1px 實心;左邊框:按鈕面 1px 實心;右邊框:按鈕面 1px 實心; BORDER-TOP:按鈕面 1px 實心;遊標:預設;左:0 像素;位置:絕對;頂部:0px } #menu .menu { 背景:buttonface; BORDER-BOTTOM:按鈕反白顯示 2px 開始; BORDER-LEFT:按鈕反白 2px 開始; BORDER-RIGHT:按鈕反白 2px 開始; BORDER-TOP:按鈕反白 2px 開始;位置:絕對 } #menu TD { 字型:選單;高度:20px } #menu .root { 邊框-底部:按鈕面 1px 實心;左邊框:按鈕面 1px 實心;右邊框:按鈕面 1px 實心; BORDER-TOP:按鈕面 1px 實心;邊距:6 像素;底部填充:1px;左內邊距:7px;右內邊距:7px; PADDING-TOP: 1px } #menu .icon { TEXT-ALIGN: center } #menu .disabled { COLOR: buttonshadow } #menu .more { FONT-FAMILY: webdings;文字對齊:右;寬度:20px } #menu #handle { 邊框底部:buttonshadow 1px 實心; BORDER-LEFT:按鈕反白顯示 1px 實心;右邊框:buttonshadow 1px 實心; BORDER-TOP:按鈕反白顯示 1px 實心;遊標:移動;邊距:0 像素;底部填充:0px;左內邊距:0px;右內邊距:0px; PADDING-TOP: 0px } #outerDiv { BORDER-BOTTOM: 白色 2px 插圖;左邊框:白色 2px 插圖;右邊框:白色 2px 插圖; BORDER-TOP:白色 2px 插圖;身高:90%;溢出:自動;位置:絕對;寬度:100%; Z-INDEX: -1 } </style> <SCRIPT> var activeMenu = null; var activeSub = null; var tempEl;變數t; var hideWindowedControls = true; var ie5 = (document.getElementsByTagName != null); function menuItemHighlight(el) { el.style.background = "突出顯示"; el.style.color = "突出顯示文字"; } function menuItemNormal(el) { el.style.background = ""; el.style.color = ""; } function raiseButton(el) { el.style.borderTop ="1 實體按鈕反白"; el.style.borderLeft =“1 個實心按鈕反白”; el.style.borderBottom =「1 個實心按鈕陰影」; el.style.borderRight ="1 個實心按鈕陰影"; el.style.padding =“1”; el.style.paddingLeft = "7"; el.style.paddingRight = "7"; } function normalButton(el) { el.style.border = "1 個實心按鈕面"; el.style.padding =“1”; el.style.paddingLeft = "7"; el.style.paddingRight = "7"; } function PressedButton(el) { el.style.borderTop ="1 實心按鈕陰影"; el.style.paddingTop = "2"; el.style.borderLeft =“1 個實心按鈕陰影”; el.style.paddingLeft = "8"; el.style.borderBottom =“1 個實心按鈕反白”; el.style.paddingBottom=“0”; el.style.borderRight = "1 個實心按鈕反白顯示"; el.style.paddingRight = "6"; } function cleanUpMenuBar() { for (i=0; i <menu.rows.length; i++) { for (j=0; j <menu.rows(i).cells.length; j++) { if (menu.rows (i).cells(j).className == "root") { normalButton(menu.rows(i).cells(j)); showWindowedObjects(true); } 函數 getMenuItem(el) { temp = el; while ((temp!=null) && (temp.tagName!="TABLE") && (temp.id!="menubar") && (temp.id!="menu") && (temp.id!="handle ")) { if ((temp.tagName=="TR") || (temp.className=="root")) el = temp; temp = temp.parentElement;返回el; } 函數 getSub(el) { temp = el; while ((temp!=null) && (temp.className != "sub")) { if (temp.tagName=="TABLE") el = temp; temp = temp.parentElement;返回el; } function menuClick() { if (event.srcElement == null) return; } var el=getMenuItem(event.srcElement); if ((el.className != "disabled") && (el.id != "menubar")){ if (el.className == "root") { if (activeMenu) { raiseButton(el); }顯示視窗物件(真);否則按下按鈕(el);切換菜單(el); } else if (el.href) { cleanUpMenuBar();如果(activeMenu)toggleMenu(activeMenu.parentElement); if (el.target) window.open(el.href, el.target); else if (document.all.tags("BASE").item(0) != null) window.open(el.href, document.all.tags("BASE").item(0).target);否則 window.location = el.href; } } window.event.cancelBubble = true; } 函式 Restore() { if (activeMenu) {toggleMenu(activeMenu.parentElement);清理選單欄(); document.onclick=恢復; function menuOver() { if ((event.fromElement == null) || (event.toElement == null) || (event.fromElement == event.toElement)) return; } var fromEl = getMenuItem(event.fromElement); var toEl = getMenuItem(event.toElement); if (fromEl == toEl) 返回; if ((toEl.className != "disabled") && (toEl.id != "menubar")){ if (toEl.className == "root") { if (activeMenu) { if (toEl.menu != activeMenu ) ) { cleanUpMenuBar();按下按鈕(toEl);切換選單(toEl); } } else { raiseButton(toEl); } } else { if ((fromEl != toEl) && (toEl.tagName != "TABLE")){ cleanup(toEl.parentElement.parentElement, false);選單項目突出顯示(toEl); toEl.parentElement.parentElement.activeItem = toEl; if (toEl.href) window.status = toEl.href; if (toEl.className == "sub") showSubMenu(toEl,true); } } } } function menuOut() { if ((event.fromElement == null) || (event.toElement == null) || (event.fromElement == event.toElement)) return; var fromEl = getMenuItem(event.fromElement); var toEl = getMenuItem(event.toElement); if (fromEl == toEl) 返回; if (fromEl.className == "root"){ if (activeMenu) { if (fromEl.menu != activeMenu) normalButton(fromEl); }否則正常按鈕(fromEl); } else { if ((fromEl.className != "disabled") && (fromEl.id != "menubar")){ if ((fromEl.className == "sub") && (getSub(toEl) == fromEl. subMenu) || (fromEl.subMenu == toEl.parentElement.parentElement)) 返回; else if ((fromEl.className == "sub")){ cleanup(fromEl.subMenu, true); } menuItemNormal(fromEl); } else if ((fromEl != toEl) && (fromEl.tagName != "TABLE")) menuItemNormal(fromEl);視窗狀態=“”; } } } 函數toggleMenu(el) { if (el.menu == null) el.menu = getChildren(el); if (el.menu == activeMenu) { if (activeSub) menuItemNormal(activeSub.parentElement.parentElement); }清理(el.menu,true);活動菜單=空; activeSub = null; // showWindowedObjects(true); } else { if (activeMenu) { cleanup(activeMenu,true); }隱藏菜單(活動菜單); } activeMenu = el.menu; var tPos = topPos(el.menu) + menu.offsetHeight; if ((document.body.offsetHeight - tPos) >= el.menu.offsetHeight) { el.menu.style.pixelTop = (ie5) ? el.offsetHeight + 1 : menu.offsetHeight - el.offsetTop - 2;目錄=2; } else { el.menu.style.pixelTop = (ie5) ? el.offsetTop - el.menu.offsetHeight - 1 : el.offsetTop - el.menu.offsetHeight + 2;目錄=8; } el.menu.style.pixelLeft = (ie5) ? el.offsetLeft - 2 : el.offsetLeft;顯示(el.選單,目錄);顯示視窗物件(假); } } 函數 showSubMenu(el,show) { var dir = 2;溫度=埃爾;列表 = el.children.tags("TD"); el = list[list.length-1]; if (el.menu == null) el.menu = getChildren(el); temp.subMenu = el.menu; if ((el.menu != activeMenu) && (show)) { activeSub = el.menu; var lPos = leftPos(el.menu); if ((document.body.offsetWidth - lPos) >= el.menu.offsetWidth) { el.menu.style.left = (ie5) ? el.parentNode.offsetWidth : el.offsetParent.offsetWidth;目錄=6; } else { el.menu.style.left = - el.menu.offsetWidth + 3;目錄=4; } var tPos = (ie5) ? topPos(el.menu) + el.offsetTop : topPos(el.menu) + el.offsetParent.offsetTop;// + el.menu.offsetTop; if ((document.body.offsetHeight - tPos) >= el.menu.offsetHeight) el.menu.style.top = (ie5) ? el.offsetTop - 4 : el.offsetParent.offsetTop - 2;否則 el.menu.style.top = (ie5) ? el.offsetTop + el.offsetHeight - el.menu.offsetHeight : el.offsetParent.offsetTop + el.offsetParent.offsetHeight - el.menu.offsetHeight + 2; showSub(el.menu, dir); } else { 顯示(el.menu ,dir); activeSub = null; } } 函數 topPos(el) { var temp = el; var y = 0; while (temp.id!="menu") { temp = temp.offsetParent; y += temp.offsetTop;返回y; } 函數 leftPos(el) { var temp = el; var x = 0; while (temp.id!="menu") { temp = temp.offsetParent; x += temp.offsetLeft;返回 x + el.offsetParent.offsetWidth; } function show(el, dir) { if (typeof(fade) == "function") fade(el, true); } else if (typeof(swipe) == "函數") { tempElSwipe = el; tempDirSwipe = 目錄; el.style.visibility = "可見"; el.style.visibility = "隱藏"; window.setTimeout("tempSwipe()", 0); // 滑動(el,目錄); } else el.style.visibility = "可見"; } var tempElSwipe, tempDirSwipe;函數 tempSwipe() { swipe(tempElSwipe, tempDirSwipe); } 函數 showSub(el ,dir) { show(el, dir); // 滑動(el,目錄); // 淡入淡出(el, true); // el.style.visibility = "可見"; } function cleanup(menu,hide) { if (menu.activeItem) { //如果你以前來過這裡 if ((menu.activeItem.className == "sub") && (menu.activeItem.subMenu)){ / /活動項目有子選單cleanup(menu.activeItem.subMenu, true); //也清理子項 } menuItemNormal(menu.activeItem); } if (隱藏) { hideMenu(選單); } } 函數 hideMenu(el) { if (typeof(fade) == "function") { fade(el, false); // window.setTimeout(fadeTimer); } else if (typeof(swipe) == "函數") { hideSwipe(el); } else el.style.visibility = "隱藏"; } function getChildren(el) { var tList = el.children.tags("TABLE");返回tList[0]; } var DragObject = null; var DragObjectPos = "頂部"; var tx;變種; window.onload=fixSize; window.onresize=fixSize;函數fixSize(){ if(dragObjectPos ==“頂部”){outerDiv.style.top = menu.offsetHeight; externalDiv.style.height = document.body.clientHeight - menu.offsetHeight; } else if(dragObjectPos == "bottom") {outerDiv.style.top = 0; externalDiv.style.height = document.body.clientHeight - menu.offsetHeight; menu.style.top = document.body.clientHeight - menu.offsetHeight; } else { 外層Div.style.top = 0; externalDiv.style.height=document.body.clientHeight; } } function document.onmousedown() { if(window.event.srcElement.id == "handle") { DragObject = document.all[window.event.srcElement.getAttribute("for")];恢復(); //移動時隱藏選單 ty = (window.event.clientY - DragObject.style.pixelTop); window.event.returnValue = false; window.event.cancelBubble = true; } else { 拖曳物件 = null; } } function document.onmouseup() { if(dragObject) { DragObject = null; } } function document.onmousemove() { if(dragObject) { if(window.event.clientX >= 0) { if((window.event.clientY - ty) <= 15) { DragObject.style.border = "0實心按鈕面」; DragObject.style.width = "100%";拖曳物件.style.top = 0;拖曳物件.style.left = 0; DragObjectPos = "頂部";修復大小(); } else if ((window.event.clientY - ty) >= document.body.clientHeight - menu.offsetHeight - 15) { DragObject.style.border = "0 實體按鈕面"; DragObject.style.width = "100%"; DragObject.style.top = document.body.clientHeight - menu.offsetHeight;拖曳物件.style.left = 0; DragObjectPos =「底部」;修復大小(); } else { DragObject.style.width =“10px”; DragObject.style.left = window.event.clientX; DragObject.style.top = window.event.clientY - ty; DragObject.style.border = "2px 開頭白色"; DragObjectPos = "浮動";修復大小(); } } else { DragObject.style.border = ""; DragObject.style.left =「0」; DragObject.style.top = "0"; } window.event.returnValue = false; window.event.cancelBubble = true; } } function showWindowedObjects(show) { if (hideWindowedControls) { var windowedObjectTags = new Array("SELECT", "IFRAME", "OBJECT", "APPLET","EMBED"); var windowedObjects = new Array();變數j=0; for (var i=0; i<windowedObjectTags.length; i++) { var tmpTags = document.all.tags(windowedObjectTags[i]); if (tmpTags.length > 0) { for (var k=0; k<tmpTags.length; k++) { windowedObjects[j++] = tmpTags[k]; } for (var i=0; i<windowedObjects.length; i++) { if (!show) windowedObjects[i].visBackup = (windowedObjects[i].style.visibility == null) ? 「可見」:windowedObjects[i].style.visibility; windowedObjects[i].style.visibility = (顯示) ? windowedObjects[i].visBackup : "隱藏"; } } } </SCRIPT> <TABLE cellSpacing=1 id=menu onclick=menuClick() onmouseout=menuOut() onmouseover=menuOver() onselectstart="return false"> <TBODY> <TR id=menubar> <TD class=menubar> <TD class= disabled style="PADDING-LEFT: 0px; PADDING-RIGHT: 1px"> <DIV class=disabled id=handle style="HEIGHT: 100%; LEFT: 3px; WIDTH: 3px" title="移動我!" for="menu"></DIV></TD> <TD class=root>HOME <TABLE cellSpacing=0 class=menu style="VISIBILITY: hide"> <TBODY> <TR href="javascript:alert('可以改成一個連結! <TD noWrap>LINK</TD> <TD> <TABLE cellSpacing=0 class=menu style="VISIBILITY: hide"> <TBODY> <TR href="javascript:alert('可以改成一個連結')"> <TD noWrap style="HEIGHT: 20px">連結</TD> </TR> </TBODY> </TABLE> </TD> </TR> <TR class=disabled> <TD colSpan=3> <HR > </TD> </TR> <TR href="javascript:alert('可以改成一個連結')"> <TD></TD> <TD>LINK</TD> <TD></TD> </TR> <TR title="這真的很簡單"> <TD></TD> <TD>LINK</TD> <TD></TD> </TR> </TBODY> </TABLE> < /TD> <TD class=root>幫助<TABLE cellSpacing=0 class=menu style="VISIBILITY: hide"> <TBODY> <TR href="javascript:alert('www.downcodes.com')"> < TD ></TD> <TD>關於</TD> <TD></TD></TR></TBODY></TABLE></TD> <TD class=disabled width="100%"> < / TD></TR></TBODY></TABLE> <DIV id=outerDiv>