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
Commentaires et avis
|
Derniers Blogs
TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE !MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE ! par Vko
Hier durant une session dédiée aux Techdays 2012, j'ai eu le plaisir d'annoncer la sortie de la Béta 2 de Mishra Reader. C'est quoi ? Pour les utilisateurs, c'est une vraie expérience de lecture de flux RSS sur Windows. Rien à voir avec les produit...
Cliquez pour lire la suite de l'article par Vko [FRAMEWORK 4] LES TASKS ET LE THREAD UI[FRAMEWORK 4] LES TASKS ET LE THREAD UI par fathi
Je viens de passer quelques temps au TechDay's et j'ai pu voir pas mal de session intéressante. Par contre une chose m'a un peu étonné lors de certaines de ces sessions qui abordaient les améliorations du framework .NET (donc le 4.5) : en gros, bea...
Cliquez pour lire la suite de l'article par fathi WORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBEWORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBE par JeremyJeanson
Depuis déjà un an, je conseille vivement les utilisateurs de Workflow Foundation 3 à migrer vers la version 4. L'information qui va suivre ne devrait donc pas trop prendre au dépourvu les personnes qui m'ont suivi. Je profite de ce poste, pour faire le re...
Cliquez pour lire la suite de l'article par JeremyJeanson TECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PCTECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PC par ROMELARD Fabrice
Speakers: Thierry Rapatout, Antoine Petit et Xavier Trebbia Cette session entre dans le cadre des RDV Décideurs des TechDays 2012, elle est liée à la consumérisation de l'IT et la mise en place du "DeskTop as a Service" dans de plus en ...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|