Français
<!-- 把如下代码加入<body>区域中 --> <!-- web http://www.downcodes.com --> <!-- bbs http://www.downcodes.com/bbs- -> <style rel=stylesheet type=text/css> BODY { BORDER-BOTTOM : 0px; BORDURE GAUCHE : 0px ; BORDURE DROITE : 0px ; BORDURE-HAUT : 0px ; MARGE : 0px ; couleur : texte du bouton } #menu { FOND : face du bouton ; BORDURE-BAS : face du bouton 1px solide ; BORDURE GAUCHE : face du bouton 1px solide ; BORDURE DROITE : face du bouton 1px solide ; BORDURE-TOP : face du bouton 1px solide ; CURSEUR : par défaut ; GAUCHE : 0 px ; POSITION : absolue ; HAUT : 0px } #menu .menu { FOND : bouton ; BORDURE-BAS : bouton surligner 2 px au début ; BORDURE GAUCHE : bouton surligner 2 px au début ; BORDURE DROITE : bouton surligner 2 px au début ; BORDURE-TOP : bouton surligner 2 px au début ; POSITION : absolue } #menu TD { POLICE : menu ; HAUTEUR : 20px } #menu .root { BORDER-BOTTOM : bouton face 1px solide ; BORDURE GAUCHE : face du bouton 1px solide ; BORDURE DROITE : face du bouton 1px solide ; BORDURE-TOP : face du bouton 1px solide ; MARGE : 6 px ; REMBOURRAGE-FOND : 1px ; REMBOURRAGE-GAUCHE : 7 px ; PADDING-DROITE : 7 px ; PADDING-TOP : 1px } #menu .icon { TEXT-ALIGN : centre } #menu .disabled { COULEUR : boutonombre } #menu .more { FONT-FAMILY : webdings ; TEXTE-ALIGN : à droite ; LARGEUR : 20px } #menu #handle { BORDER-BOTTOM : ombre du bouton 1px solid ; BORDURE GAUCHE : bouton surligner 1px solide ; BORDURE DROITE : ombre du bouton 1px solide ; BORDURE-TOP : bouton surligner 1px solide ; CURSEUR : déplacer ; MARGE : 0px ; PADDING-BOTTOM : 0px ; PADDING-GAUCHE : 0px ; PADDING-DROITE : 0px ; PADDING-TOP : 0px } #outerDiv { BORDER-BOTTOM : encart blanc de 2 px ; BORDURE À GAUCHE : encart blanc de 2 px ; BORDURE À DROITE : encart blanc de 2 px ; BORDURE-TOP : encart blanc de 2 px ; HAUTEUR : 90 % ; DÉBORDEMENT : auto ; POSITION : absolue ; LARGEUR : 100 % ; Z-INDEX : -1 } </style> <SCRIPT> var activeMenu = null ; var activeSub = nul ; var tempEl; vart; var hideWindowedControls = true; var ie5 = (document.getElementsByTagName != null); function menuItemHighlight(el) { el.style.background = "highlight"; el.style.color = "texte surligné" ; } function menuItemNormal(el) { el.style.background = ""; el.style.color = ""; } function raiseButton(el) { el.style.borderTop ="1 bouton solide en surbrillance"; el.style.borderLeft ="1 bouton solide en surbrillance"; el.style.borderBottom ="1 ombre de bouton solide"; el.style.borderRight ="1 ombre de bouton solide"; el.style.padding ="1"; el.style.paddingLeft = "7"; el.style.paddingRight = "7"; } function normalButton(el) { el.style.border = "1 bouton solide"; el.style.padding ="1"; el.style.paddingLeft = "7"; el.style.paddingRight = "7"; } function selectedButton(el) { el.style.borderTop ="1 solid boutonombre"; el.style.paddingTop = "2"; el.style.borderLeft ="1 ombre de bouton solide"; el.style.paddingLeft = "8"; el.style.borderBottom ="1 bouton solide en surbrillance"; el.style.paddingBottom= "0"; el.style.borderRight = "1 bouton solide en surbrillance"; 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; } renvoie el; } function getSub(el) { temp = el; while ((temp!=null) && (temp.className != "sub")) { if (temp.tagName=="TABLE") el = temp; temp = temp.parentElement; } renvoie 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); showWindowedObjects(true); } sinonpressedButton(el); basculeMenu(el); } sinon if (el.href) { cleanUpMenuBar(); if (activeMenu) toggleMenu(activeMenu.parentElement); if (el.target) window.open(el.href, el.target); sinon if (document.all.tags("BASE").item(0) != null) window.open(el.href, document.all.tags("BASE").item(0).target); sinon window.location = el.href; } } window.event.cancelBubble = true; } function Restore() { if (activeMenu) { toggleMenu(activeMenu.parentElement); cleanUpMenuBar(); } } document.onclick=Restaurer ; 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) return ; if ((toEl.className != "disabled") && (toEl.id != "menubar")){ if (toEl.className == "root") { if (activeMenu) { if (toEl.menu != activeMenu ) { cleanUpMenuBar(); boutonpressé(àEl); basculeMenu(versEl); } } else { raiseButton(toEl); } } else { if ((fromEl != toEl) && (toEl.tagName != "TABLE")){ cleanup(toEl.parentElement.parentElement, false); menuItemHighlight(toEl); toEl.parentElement.parentElement.activeItem = toEl; si (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) return ; if (fromEl.className == "root"){ if (activeMenu) { if (fromEl.menu != activeMenu) normalButton(fromEl); } else normalButton(fromEl); } else { if ((fromEl.className != "disabled") && (fromEl.id != "menubar")){ if ((fromEl.className == "sub") && (getSub(toEl) == fromEl. subMenu) || (fromEl.subMenu == toEl.parentElement.parentElement)) return; sinon if ((fromEl.className == "sub")){ cleanup(fromEl.subMenu, true); menuItemNormal(fromEl); } else if ((fromEl != toEl) && (fromEl.tagName != "TABLE")) menuItemNormal(fromEl); fenêtre.status = "" ; } } } function toggleMenu(el) { if (el.menu == null) el.menu = getChildren(el); if (el.menu == activeMenu) { if (activeSub) menuItemNormal(activeSub.parentElement.parentElement); nettoyage(el.menu,true); actifMenu = nul ; activeSub = nul ; // showWindowedObjects(true); } else { if (activeMenu) { cleanup(activeMenu,true); cacherMenu(activeMenu); } 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; répertoire = 2 ; } else { el.menu.style.pixelTop = (ie5) ? el.offsetTop - el.menu.offsetHeight - 1 : el.offsetTop - el.menu.offsetHeight + 2; répertoire = 8 ; } el.menu.style.pixelLeft = (ie5) ? el.offsetLeft - 2 : el.offsetLeft; show(el.menu, dir); showWindowedObjects(faux); } } function showSubMenu(el,show) { var dir = 2; temp = el; list = el.children.tags("TD"); el = liste[liste.longueur-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; répertoire = 6 ; } else { el.menu.style.left = - el.menu.offsetWidth + 3; répertoire = 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; sinon 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 { show(el.menu,dir); activeSub = nul ; } } function topPos(el) { var temp = el; var y = 0; while (temp.id!="menu") { temp = temp.offsetParent; y += temp.offsetTop; } renvoie y ; } function leftPos(el) { var temp = el; variable x = 0 ; while (temp.id!="menu") { temp = temp.offsetParent; x += temp.offsetLeft; } return x + el.offsetParent.offsetWidth; } function show(el, dir) { if (typeof(fade) == "function") fade(el, true); sinon if (typeof(swipe) == "function") { tempElSwipe = el; tempDirSwipe = dir; el.style.visibility = "visible"; el.style.visibility = "caché" ; window.setTimeout("tempSwipe()", 0); // glisser(el, dir); } else el.style.visibility = "visible"; } var tempElSwipe, tempDirSwipe ; function tempSwipe() { glisser(tempElSwipe, tempDirSwipe); } function showSub(el, dir) { show(el, dir); // glisser(el, dir); // fondu(el, vrai); // el.style.visibility = "visible"; } function cleanup(menu,hide) { if (menu.activeItem) { //Si vous êtes déjà venu ici if ((menu.activeItem.className == "sub") && (menu.activeItem.subMenu)){ / /L'élément actif a un sous-menu de nettoyage (menu.activeItem.subMenu, true); //Nettoyer également les sous-marins } menuItemNormal(menu.activeItem); } if (cacher) { cacherMenu(menu); } } function hideMenu(el) { if (typeof(fade) == "function") { fade(el, false); // window.setTimeout(fadeTimer); } else if (typeof(swipe) == "function") { hideSwipe(el); } else el.style.visibility = "caché"; } function getChildren(el) { var tList = el.children.tags("TABLE"); renvoie la tListe[0] ; } var dragObject = null; var dragObjectPos = "top"; var tx; varty; window.onload=fixSize; window.onresize=fixSize; function fixSize() { if (dragObjectPos == "top") { externalDiv.style.top = menu.offsetHeight; externalDiv.style.height = document.body.clientHeight - menu.offsetHeight; } else if( dragObjectPos == "bottom") { externalDiv.style.top = 0; externalDiv.style.height = document.body.clientHeight - menu.offsetHeight; menu.style.top = document.body.clientHeight - menu.offsetHeight; } else { externalDiv.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")]; Restaurer(); //Masquer les menus lors du déplacement ty = (window.event.clientY - dragObject.style.pixelTop); window.event.returnValue = faux ; 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 bouton plein" ; dragObject.style.width = "100%"; dragObject.style.top = 0; dragObject.style.left = 0; dragObjectPos = "haut" ; fixSize(); } else if ((window.event.clientY - ty) >= document.body.clientHeight - menu.offsetHeight - 15) { dragObject.style.border = "0 solid buttonface"; dragObject.style.width = "100%"; dragObject.style.top = document.body.clientHeight - menu.offsetHeight ; dragObject.style.left = 0; dragObjectPos="bas"; fixSize(); } else { dragObject.style.width = "10px"; dragObject.style.left = window.event.clientX; dragObject.style.top = window.event.clientY - ty; dragObject.style.border = "Début blanc 2px"; dragObjectPos = "float"; fixSize(); } } 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(); variable 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) ? "visible" : windowedObjects[i].style.visibility; windowedObjects[i].style.visibility = (afficher) ? windowedObjects[i].visBackup : "caché"; } } } </SCRIPT> <TABLE cellSpacing=1 id=menu onclick=menuClick() onmouseout=menuOut() onmouseover=menuOver() onselectstart="return false"> <TBODY> <TR id=menubar> <TD class= désactivé style="PADDING-LEFT: 0px; PADDING-RIGHT: 1px"> <DIV class=disabled id=handle style="HAUTEUR: 100%; GAUCHE: 3px; WIDTH: 3px" title="Déplacez-moi!" for="menu"></DIV></TD> <TD class=root>HOME <TABLE cellSpacing=0 class=menu style="VISIBILITY: caché"> <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>LIEN</TD> <TD></TD> </TR> <TR title="C'est vraiment simple"> <TD></TD> <TD>LINK</TD> <TD></TD> </TR> </TBODY> </TABLE> < /TD> <TD class=root>Aide <TABLE cellSpacing=0 class=menu style="VISIBILITY: Hidden"> <TBODY> <TR href="javascript:alert('www.downcodes.com')"> <TD ></TD> <TD>À propos</TD> <TD></TD></TR></TBODY></TABLE></TD> <TD class=disabled width="100%"> </ TD></TR></TBODY></TABLE> <DIV id=outerDiv>