begin process at 2012 02 14 04:55:37
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Menu & Co

 > MENU AVEC EFFET DE DÉGRADÉ

MENU AVEC EFFET DE DÉGRADÉ


 Information sur la source

Note :
2,17 / 10 - par 6 personnes
2,17 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Menu & Co Niveau :Débutant Date de création :11/06/2004 Vu :22 395

Auteur : francktfr

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

 Description

Cliquez pour voir la capture en taille normale
le menu n'est la que pour l'exemple :o)

Source

  • <HTML>
  • <HEAD>
  • <TITLE></TITLE>
  • <STYLE>
  • .MenuCell{border:1 solid #006699;font: 12 Arial;}
  • .MenuTable{font: 12 Arial; table-layout: fixed; border-collapse: collapse; width: 70px;}
  • A{width: 100%; text-decoration: none; text-indent: 2px;}
  • </STYLE>
  • </HEAD>
  • <BODY>
  • <SCRIPT>
  • // pour la démo
  • sHTML = "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 CLASS='MenuTable'>"
  • for (i=1; i<=10; i++){
  • sHTML += "<TR><TD ID='MnuCell_" + i + "' onmouseover=\"gradient(0,'MnuCell_" + i + "')\" CLASS='MenuCell'><A HREF=\"#\">Page " + i + "</A></TD></TR>"
  • }
  • sHTML += "</TABLE>"
  • document.write(sHTML)
  • var Colors = new Array()
  • Colors = InitColors("#000099","#FFFFFF",30)
  • function gradient(i, id){
  • if (i<Colors.length){document.getElementById(id).style.backgroundColor = "#" + Colors[i]
  • setTimeout("gradient("+(i+1)+",'"+id+"')",11)
  • }
  • }
  • // convertion decimal ver hexa
  • function Hexa(Dec){
  • var nb = Dec.toString(16)
  • if (nb.length < 2) {nb = "0" + nb}
  • return(nb)
  • }
  • // creation du tableau de couleurs
  • function InitColors(ColorStart, ColorEnd, Steps){
  • // si les couleurs viennent d'une propriété de style :
  • Start = ColorStart.replace("#","")
  • End = ColorEnd.replace("#","")
  • var StartRed = parseInt(Start.substring(0, 2),16)
  • var StartGreen = parseInt(Start.substring(2, 4),16)
  • var StartBlue = parseInt(Start.substring(4, 6),16)
  • var EndRed = parseInt(End.substring(0, 2),16)
  • var EndGreen = parseInt(End.substring(2, 4),16)
  • var EndBlue = parseInt(End.substring(4, 6),16)
  • var Colors = new Array()
  • cr=StartRed; cg=StartGreen; cb=StartBlue
  • sr = (EndRed - StartRed)/Steps // rouge
  • sg = (EndGreen - StartGreen)/Steps // vert
  • sb = (EndBlue - StartBlue)/Steps // bleu
  • for (var x = 0; x <= Steps; x++) {
  • Colors[x] = Hexa(Math.floor(cr)) + Hexa(Math.floor(cg)) + Hexa(Math.floor(cb))
  • cr += sr; cg += sg; cb += sb
  • }
  • return(Colors)
  • }
  • </SCRIPT>
  • </BODY>
  • </HTML>
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE>
.MenuCell{border:1 solid #006699;font: 12 Arial;}
.MenuTable{font: 12 Arial; table-layout: fixed; border-collapse: collapse; width: 70px;}
A{width: 100%; text-decoration: none; text-indent: 2px;}
</STYLE>
</HEAD>
<BODY>

<SCRIPT>
//	pour la démo
sHTML = "<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 CLASS='MenuTable'>"
	for (i=1; i<=10; i++){
		sHTML += "<TR><TD ID='MnuCell_" + i + "' onmouseover=\"gradient(0,'MnuCell_" + i + "')\" CLASS='MenuCell'><A HREF=\"#\">Page " + i + "</A></TD></TR>"
	}
sHTML += "</TABLE>"
document.write(sHTML)

var Colors = new Array()
Colors = InitColors("#000099","#FFFFFF",30)
function gradient(i, id){
	if (i<Colors.length){document.getElementById(id).style.backgroundColor  = "#" + Colors[i]
	setTimeout("gradient("+(i+1)+",'"+id+"')",11)
	}
}
//  convertion decimal ver hexa 
function Hexa(Dec){ 
  var nb = Dec.toString(16) 
  if (nb.length < 2) {nb = "0" + nb} 
  return(nb) 
} 
//	creation du tableau de couleurs
function InitColors(ColorStart, ColorEnd, Steps){ 
  //	si les couleurs viennent d'une propriété de style :
  Start = ColorStart.replace("#","")
  End = ColorEnd.replace("#","")
	
  var StartRed = parseInt(Start.substring(0, 2),16) 
  var StartGreen = parseInt(Start.substring(2, 4),16) 
  var StartBlue = parseInt(Start.substring(4, 6),16) 
  var EndRed = parseInt(End.substring(0, 2),16) 
  var EndGreen = parseInt(End.substring(2, 4),16) 
  var EndBlue = parseInt(End.substring(4, 6),16) 
  var Colors = new Array()
  cr=StartRed; cg=StartGreen; cb=StartBlue 
  sr = (EndRed - StartRed)/Steps  // rouge 
  sg = (EndGreen - StartGreen)/Steps  // vert 
  sb = (EndBlue - StartBlue)/Steps  // bleu 
	for (var x = 0; x <= Steps; x++) { 
		Colors[x] = Hexa(Math.floor(cr)) + Hexa(Math.floor(cg)) + Hexa(Math.floor(cb)) 
		cr += sr; cg += sg; cb += sb 
	} 
	return(Colors)
} 
</SCRIPT>
</BODY>
</HTML>



 Sources du même auteur

Source avec une capture CHOIX DE DATES ET DE PERIODE
HORLOGE DIGITALE , SI SI
Source avec une capture TEXT COLORISÉ AVEC LE POURCENTAGE
ANNONCE LETTRE PAR LETTRE
ECLATEZ LE TEXTE

 Sources de la même categorie

Source avec Zip Source avec une capture UN MENU EN CSS par Julien39
Source avec Zip FLÈCHE CLIGNOTANTE AU SURVOL D'UN LIEN par lecurieux41
Source avec Zip Source avec une capture TREEMENU-2.3.6-MACNIP par neep
Source avec Zip Source avec une capture MENU CIRCULAIRE par adelmonis
Source avec Zip Source avec une capture MENU TASKBAR WINDOWSXP HOME par micking

Commentaires et avis

Aucun commentaire pour le moment.

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
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 : 7,660 sec (4)

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