Accueil > > > MENU DÉROULENT DANS UNE PAGE WEB
MENU DÉROULENT DANS UNE PAGE WEB
Information sur la source
Description
Comment faire un menu déroulent sur votre page web. C'est facile :
Source
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML><HEAD><TITLE>New Page 6</TITLE>
- <META http-equiv=Content-Type content="text/html; charset=windows-1252">
- <META content="MSHTML 6.00.2719.2200" name=GENERATOR></HEAD>
- <BODY>
- <P><SPAN id=test style="POSITION: absolute"></SPAN></P>
- <SCRIPT language=JavaScript1.2>
- <!--
-
- var NS4 = (document.layers) ? true : false;
- var IE4 = (document.all) ? true : false;
- var maxZ = 1;
-
- function popout(id, posY, width) {
- this.id = id; // the element's name (and the variable's name)
- this.posY = posY; // the element's top property
- this.width = width; // the element's width
- this.show = false; // do not show the element
- this.makeImage = makeImage; // constructs the image's tab
- this.makeElement = makeElement; // constructs the content box
- this.showElement = showElement; // sets the element's visibility
- }
-
- function makeImage(imgURL, imgHeight, imgWidth, imgAlt) {
- document.write(
- '<STYLE TYPE="text/css">',
- '#', this.id, 'img {',
- 'position: absolute;',
- 'left: 0; top: ', this.posY, ';',
- 'width: ', imgWidth, ';',
- 'z-index: 1',
- '}',
- '</STYLE>',
- '<DIV ID="', this.id, 'img">',
- '<A HREF="javascript:', this.id, '.showElement()">',
- '<IMG SRC="', imgURL, '" ALT="', imgAlt, '" BORDER="0" ',
- 'HEIGHT="', imgHeight, '" WIDTH="', imgWidth, '">',
- '</A></DIV>'
- );
- }
-
- function makeElement(boxBg, boxColor, boxCode) {
- var padding = (NS4) ? '' : 'padding: 3 0 3 3;';
- document.write(
- '<STYLE TYPE="text/css">',
- '#', this.id, 'box {',
- 'position: absolute;',
- 'left: 0; top: ', this.posY, ';',
- 'width: ', this.width, ';',
- 'layer-background-color: ', boxBg, ';',
- 'background-color: ', boxBg, ';',
- 'visibility: hidden;',
- 'border-width: 2;',
- 'border-style: solid;',
- 'border-color: ', boxColor, ';',
- padding,
- 'z-index: 1',
- '}',
- '</STYLE>',
- '<DIV ID="', this.id, 'box">',
- boxCode,
- '</DIV>'
- );
- }
-
- function showElement() {
- this.show = !this.show;
- var pos = (this.show) ? this.width : 0;
- if (NS4) {
- var str = (this.show) ? 'show' : 'hide';
- eval('document.' + this.id + 'img.left = ' + pos);
- eval('document.' + this.id + 'img.zIndex = ' + (++maxZ));
- eval('document.' + this.id + 'box.zIndex = ' + maxZ);
- eval('document.' + this.id + 'box.visibility = "' + str + '"');
- } else {
- var str = (this.show) ? 'visible' : 'hidden';
- eval(this.id + 'img.style.left = ' + pos);
- eval(this.id + 'img.style.zIndex = ' + (++maxZ));
- eval(this.id + 'box.style.zIndex = ' + maxZ);
- eval(this.id + 'box.style.visibility = "' + str + '"');
- }
- }
-
- function styleEnabled() {
- return ((NS4 && document.test) || IE4);
- }
-
- function init() {
- if (!styleEnabled()) return;
- menu1 = new popout('menu1', 300, 90); // a global variable
- menu1.makeImage('columns.gif', 130, 18,
- 'JavaScript Columns');
- menu1.makeElement('beige', '#0000cc',
- '<A HREF="/js/column1/">Column 1</A><BR>' +
- '<A HREF="/js/column2/">Column 2</A><BR>' +
- '<A HREF="/js/column13/">Column 13</A>'
- );
- menu2 = new popout('menu2', 440, 200); // a global variable
- menu2.makeImage('examples.gif', 130, 18,
- 'JavaScript Examples');
- menu2.makeElement('beige', '#0000cc',
- '<IMG SRC="/js/pharmacy/docjx.gif" WIDTH="55" ' +
- 'HEIGHT="60" HSPACE="2" ALIGN="right">' +
- '<A HREF="/js/pharmacy/menu.html">A Popup Menu</A><BR>' +
- '<A HREF="/js/pharmacy/date.html">A Text Date</A><BR>' +
- '<A HREF="/js/pharmacy/countdown.html">A Date Countdown</A>'
- );
- }
-
- init();
-
- // -->
- </SCRIPT>
- </BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>New Page 6</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR></HEAD>
<BODY>
<P><SPAN id=test style="POSITION: absolute"></SPAN></P>
<SCRIPT language=JavaScript1.2>
<!--
var NS4 = (document.layers) ? true : false;
var IE4 = (document.all) ? true : false;
var maxZ = 1;
function popout(id, posY, width) {
this.id = id; // the element's name (and the variable's name)
this.posY = posY; // the element's top property
this.width = width; // the element's width
this.show = false; // do not show the element
this.makeImage = makeImage; // constructs the image's tab
this.makeElement = makeElement; // constructs the content box
this.showElement = showElement; // sets the element's visibility
}
function makeImage(imgURL, imgHeight, imgWidth, imgAlt) {
document.write(
'<STYLE TYPE="text/css">',
'#', this.id, 'img {',
'position: absolute;',
'left: 0; top: ', this.posY, ';',
'width: ', imgWidth, ';',
'z-index: 1',
'}',
'</STYLE>',
'<DIV ID="', this.id, 'img">',
'<A HREF="javascript:', this.id, '.showElement()">',
'<IMG SRC="', imgURL, '" ALT="', imgAlt, '" BORDER="0" ',
'HEIGHT="', imgHeight, '" WIDTH="', imgWidth, '">',
'</A></DIV>'
);
}
function makeElement(boxBg, boxColor, boxCode) {
var padding = (NS4) ? '' : 'padding: 3 0 3 3;';
document.write(
'<STYLE TYPE="text/css">',
'#', this.id, 'box {',
'position: absolute;',
'left: 0; top: ', this.posY, ';',
'width: ', this.width, ';',
'layer-background-color: ', boxBg, ';',
'background-color: ', boxBg, ';',
'visibility: hidden;',
'border-width: 2;',
'border-style: solid;',
'border-color: ', boxColor, ';',
padding,
'z-index: 1',
'}',
'</STYLE>',
'<DIV ID="', this.id, 'box">',
boxCode,
'</DIV>'
);
}
function showElement() {
this.show = !this.show;
var pos = (this.show) ? this.width : 0;
if (NS4) {
var str = (this.show) ? 'show' : 'hide';
eval('document.' + this.id + 'img.left = ' + pos);
eval('document.' + this.id + 'img.zIndex = ' + (++maxZ));
eval('document.' + this.id + 'box.zIndex = ' + maxZ);
eval('document.' + this.id + 'box.visibility = "' + str + '"');
} else {
var str = (this.show) ? 'visible' : 'hidden';
eval(this.id + 'img.style.left = ' + pos);
eval(this.id + 'img.style.zIndex = ' + (++maxZ));
eval(this.id + 'box.style.zIndex = ' + maxZ);
eval(this.id + 'box.style.visibility = "' + str + '"');
}
}
function styleEnabled() {
return ((NS4 && document.test) || IE4);
}
function init() {
if (!styleEnabled()) return;
menu1 = new popout('menu1', 300, 90); // a global variable
menu1.makeImage('columns.gif', 130, 18,
'JavaScript Columns');
menu1.makeElement('beige', '#0000cc',
'<A HREF="/js/column1/">Column 1</A><BR>' +
'<A HREF="/js/column2/">Column 2</A><BR>' +
'<A HREF="/js/column13/">Column 13</A>'
);
menu2 = new popout('menu2', 440, 200); // a global variable
menu2.makeImage('examples.gif', 130, 18,
'JavaScript Examples');
menu2.makeElement('beige', '#0000cc',
'<IMG SRC="/js/pharmacy/docjx.gif" WIDTH="55" ' +
'HEIGHT="60" HSPACE="2" ALIGN="right">' +
'<A HREF="/js/pharmacy/menu.html">A Popup Menu</A><BR>' +
'<A HREF="/js/pharmacy/date.html">A Text Date</A><BR>' +
'<A HREF="/js/pharmacy/countdown.html">A Date Countdown</A>'
);
}
init();
// -->
</SCRIPT>
</BODY></HTML>
Conclusion
Vous trouvier la page, avec un menu de deux listes.
Sources de la même categorie
MENU VERTICALE GAUCHE ET DROIT DEROULANTMENU VERTICALE GAUCHE ET DROIT DEROULANTc'est repris d'une de mes source (menu glissant) sauf que au lieu de deplacer un element dans le document c'est un div en overflow hidden qui s'agrand...
par kazma
MENU VERTICALE EN TRANSPARENCEMENU VERTICALE EN TRANSPARENCECe menu est complètement modifiable, les fenêtres de sous menus étant composées de plusieur images, vous pouvez modifier la taille des sous menus en...
par dlvains
MENU DÉROULANT EN IMAGESMENU DÉROULANT EN IMAGES un menu simple a modifier, il vous suffit de changer le texte sur le PSD et d'enregistrer au format PNG.
si vous modifiez la largeur des images, pe...
par dlvains
TBFRAME: TAB BROWSING FRAMETBFRAME: TAB BROWSING FRAME Cela fait un moment que j'avais eu l'idée de mettre en ligne ce script, mais je n'avais jamais eu le temps de mettre un coup de propre dans le code ai...
par triumphs
MENU PRINCIPALMENU PRINCIPALBonjour, dans ce petit source, j'ai met une belle menu avec php,javascript, css, pour me contactet , ABOUSSEBABA ALI <contact@aliwebmaster.com>, à vou...
par ali1987
Commentaires et avis
|
Derniers Blogs
TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Arnault Nouvel et Antoine Dongois Le processus à prendre : Apprendre (découvrir la plateforme) Préparer (documenter l'historique et choisir la méthode de MAJ) Test (Test de MAJ) Implémenter (Effectuer la MAJ) Valid...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : LA PLEINIèRE DU SECOND JOURTECHDAYS PARIS 2010 : LA PLEINIèRE DU SECOND JOUR par ROMELARD Fabrice
Après un retour sur l'histoire des TechDays de Paris et le fait que ce soit le plus gros event MS au monde (du fait de sa gratuité), le président de MS France (Eric Boustoullier) a fait une présentation de la vision Microsoft pour les années à venir...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|