begin process at 2010 02 09 18:03:51
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Menu & Co

 > MENU DÉROULENT DANS UNE PAGE WEB

MENU DÉROULENT DANS UNE PAGE WEB


 Information sur la source

Note :
4 / 10 - par 2 personnes
4,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Menu & Co Niveau :Initié Date de création :13/01/2004 Vu / téléchargé :11 669 / 986

Auteur : Guechtouli_Madani

Ecrire un message privé
Commentaire sur cette source (3)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
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.

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

AVOIR UNE CALCULATRISE, SUR PAGE WEB.
Source avec une capture AFFICHER L'HEURE DU NAVIGATEUR DANS LA BARE DE STATUS
Source avec une capture LA DURÉE DE VISITE D'UNE PAGE WEB.
Source avec Zip Source avec une capture UNE AMINATION AVEC AFFICHAGE D'UN SÉQUENCE D'IMAGES, UNE PAR...

 Sources de la même categorie

Source avec Zip Source avec une capture MENU VERTICALE GAUCHE ET DROIT DEROULANT par kazma
Source avec Zip Source avec une capture MENU VERTICALE EN TRANSPARENCE par dlvains
Source avec Zip Source avec une capture MENU DÉROULANT EN IMAGES par dlvains
Source avec Zip TBFRAME: TAB BROWSING FRAME par triumphs
Source avec Zip Source avec une capture MENU PRINCIPAL par ali1987

Commentaires et avis

Commentaire de pitchoune0112 le 30/03/2005 10:53:28

Ca ne marche pas avec mozilla !!

Commentaire de Anthotill le 28/08/2006 21:01:14

On peux m'expliquer pourquoi ya une gamine en photo du script ?

Commentaire de younes371 le 04/10/2006 14:05:27

lol, moi je pensais que c es la gaminne qu a fait ce travail,
je voulais telecharger le code...
Mais...

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,593 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales