Português
<!-- 把如下代码加入<body>区域中 --> <!-- web http://www.downcodes.com --> <!-- bbs http://www.downcodes.com/bbs- -> <style rel=stylesheet type=text/css> BODY { BORDER-BOTTOM: 0px; BORDA ESQUERDA: 0px; BORDA DIREITA: 0px; BORDA SUPERIOR: 0px; MARGEM: 0px; cor: texto do botão } #menu { FUNDO: face do botão; BORDA INFERIOR: face do botão 1px sólida; BORDA ESQUERDA: face do botão 1px sólida; BORDA DIREITA: face do botão 1px sólida; BORDER-TOP: face do botão 1px sólida; CURSOR: padrão; ESQUERDA: 0px; POSIÇÃO: absoluta; SUPERIOR: 0px } #menu .menu { FUNDO: botão; BORDER-BOTTOM: destaque do botão 2px no início; BORDA ESQUERDA: destaque do botão 2px no início; BORDER-RIGHT: botão realça início de 2px; BORDER-TOP: botão realce de 2px no início; POSIÇÃO: absoluta } #menu TD { FONT: menu; ALTURA: 20px } #menu .root { BORDER-BOTTOM: face do botão 1px sólido; BORDA ESQUERDA: face do botão 1px sólida; BORDA DIREITA: face do botão 1px sólida; BORDER-TOP: face do botão 1px sólida; MARGEM: 6px; PADDING-FUND: 1px; PADDING-ESQUERDA: 7px; PADDING-RIGHT: 7px; PADDING-TOP: 1px } #menu .icon { TEXT-ALIGN: center } #menu .disabled { COLOR: buttonshadow } #menu .more { FONT-FAMILY: webdings; ALINHAMENTO DE TEXTO: certo; LARGURA: 20px } #menu #handle { BORDER-BOTTOM: sombra de botão 1px sólida; BORDA ESQUERDA: destaque do botão 1px sólido; BORDA DIREITA: sombra de botão 1px sólida; BORDER-TOP: botão realce 1px sólido; CURSOR: mover; MARGEM: 0px; PADDING-FUND: 0px; PADDING-ESQUERDA: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px } #outerDiv { BORDER-BOTTOM: inserção branca de 2px; BORDA ESQUERDA: inserção branca de 2px; BORDA DIREITA: inserção branca de 2px; BORDER-TOP: inserção branca de 2px; ALTURA: 90%; EXCESSO: automático; POSIÇÃO: absoluta; LARGURA: 100%; Z-INDEX: -1 } </style> <SCRIPT> var activeMenu = null; var ativoSub = null; var tempEl; vart; var hideWindowedControls = true; var ie5 = (document.getElementsByTagName! = Nulo); function menuItemHighlight(el) { el.style.background = "destacar"; el.style.color = "texto em destaque"; } function menuItemNormal(el) { el.style.background = ""; el.style.color = ""; } function raiseButton(el) { el.style.borderTop ="1 botão sólido realçado"; el.style.borderLeft = "1 botão sólido em destaque"; el.style.borderBottom ="1 sombra de botão sólida"; el.style.borderRight = "1 sombra de botão sólida"; el.style.padding = "1"; el.style.paddingLeft = "7"; el.style.paddingRight = "7"; } function normalButton(el) { el.style.border = "1 face de botão sólida"; el.style.padding = "1"; el.style.paddingLeft = "7"; el.style.paddingRight = "7"; } function pressionadoButton(el) { el.style.borderTop ="1 sombra de botão sólida"; el.style.paddingTop = "2"; el.style.borderLeft = "1 sombra de botão sólida"; el.style.paddingLeft = "8"; el.style.borderBottom = "1 botão sólido em destaque"; el.style.paddingBottom= "0"; el.style.borderRight = "1 botão sólido em destaque"; 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); } function 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; } retornar el; } função getSub(el) { temp = el; while ((temp!=null) && (temp.className != "sub")) { if (temp.tagName=="TABLE") el = temp; temp = temp.parentElement; } retornar el; } function menuClick() { if (event.srcElement == null) return; var el=getMenuItem(event.srcElement); if ((el.className != "desativado") && (el.id != "menubar")){ if (el.className == "root") { if (activeMenu) { raiseButton(el); showWindowedObjects(true); } else pressionadoButton(el); toggleMenu(el); } else if (el.href) { cleanUpMenuBar(); if (activeMenu) toggleMenu(activeMenu.parentElement); if (el.target) window.open(el.href, el.target); senão if (document.all.tags("BASE").item(0) != null) window.open(el.href, document.all.tags("BASE").item(0).target); senão janela.location = el.href; } } window.event.cancelBubble = true; } função Restaurar() { if (activeMenu) { toggleMenu(activeMenu.parentElement); limparMenuBar(); } } document.onclick=Restaurar; função 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) retornar; if ((toEl.className != "desativado") && (toEl.id != "menubar")){ if (toEl.className == "root") { if (activeMenu) { if (toEl.menu != activeMenu ) { cleanUpMenuBar(); pressionadoButton(toEl); toggleMenu(toEl); } } else { raiseButton(toEl); } } else { if ((fromEl != toEl) && (toEl.tagName != "TABLE")){ limpeza(toEl.parentElement.parentElement, false); menuItemHighlight(toEl); toEl.parentElement.parentElement.activeItem = toEl; if (toEl.href) janela.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) retornar; if (fromEl.className == "root"){ if (activeMenu) { if (fromEl.menu != activeMenu) normalButton(fromEl); } else normalButton(fromEl); } else { if ((fromEl.className != "desativado") && (fromEl.id != "menubar")){ if ((fromEl.className == "sub") && (getSub(toEl) == fromEl. subMenu) || (fromEl.subMenu == toEl.parentElement.parentElement)) return; senão if ((fromEl.className == "sub")){ limpeza(fromEl.subMenu, true); menuItemNormal(fromEl); } else if ((fromEl != toEl) && (fromEl.tagName != "TABLE")) menuItemNormal(fromEl); janela.status = ""; } } } function toggleMenu(el) { if (el.menu == null) el.menu = getChildren(el); if (el.menu == activeMenu) { if (activeSub) menuItemNormal(activeSub.parentElement.parentElement); limpeza(el.menu,true); menu ativo = null; ativoSub = nulo; //showWindowedObjects(true); } else { if (activeMenu) { limpeza(activeMenu,true); ocultarMenu(menuativo); } 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; dir = 2; } else { el.menu.style.pixelTop = (ie5) ? el.offsetTop - el.menu.offsetHeight - 1: el.offsetTop - el.menu.offsetHeight + 2; dir = 8; } el.menu.style.pixelLeft = (ie5) ? el.offsetLeft - 2: el.offsetLeft; mostrar(el.menu, dir); showWindowedObjects(falso); } } function showSubMenu(el,show) { var dir = 2; temperatura = el; lista = el.children.tags("TD"); el = lista[lista.comprimento-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; dir = 6; } else { el.menu.style.left = - el.menu.offsetWidth + 3; dir = 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; senão 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 { mostrar(el.menu,dir); ativoSub = nulo; } } function topPos(el) { var temp = el; var y = 0; while (temp.id!="menu") { temp = temp.offsetParent; y += temp.offsetTop; } retornar y; } function leftPos(el) { var temp = el; var x = 0; while (temp.id!="menu") { temp = temp.offsetParent; x += temp.offsetLeft; } return x + el.offsetParent.offsetWidth; } function show(el, dir) { if (typeof(fade) == "função") fade(el, true); senão if (typeof(swipe) == "função") { tempElSwipe = el; tempDirSwipe = dir; el.style.visibility = "visível"; el.style.visibility = "oculto"; window.setTimeout("tempSwipe()", 0); // deslizar(el, dir); } else el.style.visibility = "visível"; } var tempElSwipe, tempDirSwipe; função tempSwipe() { swipe(tempElSwipe, tempDirSwipe); } function showSub(el,dir) { show(el, dir); // deslizar(el, dir); // fade(el, verdadeiro); // el.style.visibility = "visível"; } function cleanup(menu,hide) { if (menu.activeItem) { //Se você já esteve aqui antes if ((menu.activeItem.className == "sub") && (menu.activeItem.subMenu)){ / /O item ativo possui uma limpeza de submenu(menu.activeItem.subMenu, true); //Limpe os substitutos também } menuItemNormal(menu.activeItem); } if (ocultar) { ocultarMenu(menu); } } function hideMenu(el) { if (typeof(fade) == "function") { fade(el, false); //window.setTimeout(fadeTimer); } else if (typeof(swipe) == "função") { hideSwipe(el); } else el.style.visibility = "oculto"; } function getChildren(el) { var tList = el.children.tags("TABELA"); return Listat[0]; } var arrastarObject = null; var dragObjectPos = "topo"; var tx; var ty; janela.onload=fixSize; window.onresize=fixSize; função fixSize() { if (dragObjectPos == "top") { outerDiv.style.top = menu.offsetHeight; outerDiv.style.height = document.body.clientHeight - menu.offsetHeight; } else if( dragObjectPos == "bottom") { outerDiv.style.top = 0; outerDiv.style.height = document.body.clientHeight - menu.offsetHeight; menu.style.top=document.body.clientHeight - menu.offsetHeight; } else { outerDiv.style.top = 0; outerDiv.style.height=document.body.clientHeight; } } function document.onmousedown() { if(window.event.srcElement.id == "handle") { dragObject = document.all[window.event.srcElement.getAttribute("for")]; Restaurar(); //Ocultar os menus enquanto move ty = (window.event.clientY - dragObject.style.pixelTop); janela.event.returnValue = falso; window.event.cancelBubble=true; } else { dragObject = 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 face de botão sólida"; arrastarObject.style.width = "100%"; arrastarObject.style.top = 0; arrastarObject.style.left = 0; dragObjectPos = "topo"; fixSize(); } else if ((window.event.clientY - ty) >= document.body.clientHeight - menu.offsetHeight - 15) { dragObject.style.border = "0 solid buttonface"; arrastarObject.style.width = "100%"; dragObject.style.top = document.body.clientHeight - menu.offsetHeight; arrastarObject.style.left = 0; dragObjectPos = "inferior"; fixSize(); } else { dragObject.style.width = "10px"; arrastarObject.style.left = window.event.clientX; arrastarObject.style.top = window.event.clientY - ty; dragObject.style.border = "2px branco inicial"; dragObjectPos = "float"; fixSize(); } } else { dragObject.style.border = ""; arrastarObject.style.left = "0"; arrastarObject.style.top = "0"; } window.event.returnValue = falso; window.event.cancelBubble=true; } } function showWindowedObjects(show) { if (hideWindowedControls) { var windowedObjectTags = new Array("SELECT", "IFRAME", "OBJECT", "APPLET","EMBED"); var windowedObjects = new Array(); varj=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) ? "visível": windowedObjects[i].style.visibility; windowedObjects[i].style.visibility = (mostrar)? windowedObjects[i].visBackup : "oculto"; } } } </SCRIPT> <TABLE cellSpacing=1 id=menu onclick=menuClick() onmouseout=menuOut() onmouseover=menuOver() onselectstart="return false"> <TBODY> <TR id=menubar> <TD class= desativado estilo = "PADDING-LEFT: 0px; PADDING-RIGHT: 1px"> <DIV class=disabled id=handle style="ALTURA: 100%; ESQUERDA: 3px; LARGURA: 3px" title="Mova-me!" for="menu"></DIV></TD> <TD class=root>HOME <TABLE cellSpacing=0 class=menu style="VISIBILITY: hidden"> <TBODY> <TR href="javascript:alert('可以改成一个链接!')"> <TD></TD> <TD noWrap>LINK</TD> <TD></TD> </TR> <TR class=sub> <TD></TD> <TD noWrap>LINK</TD> <TD> <TABLE cellSpacing=0 class=menu style="VISIBILITY: hidden"> <TBODY> <TR href="javascript:alert('可以改成一个链接')"> <TD noWrap style="HEIGHT: 20px">LINK</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="Isso é realmente fácil"> <TD></TD> <TD>LINK</TD> <TD></TD> </TR> </TBODY> </TABLE> < /TD> <TD class=root>Ajuda <TABLE cellSpacing=0 class=menu style="VISIBILITY: hidden"> <TBODY> <TR href="javascript:alert('www.downcodes.com')"> <TD </TD> <TD>Sobre</TD> <TD></TD></TR></TBODY></TABLE></TD> <TD class=disabled width="100%"> </ TD></TR></TBODY></TABLE> <DIV id=outerDiv>