GRAPHISME
Sélection d'images avec menu déroulant
Permet d'afficher une image en la sélectionnant dans un menu déroulant
<form> <div align="center"><center><table border="0"> <tr><td> <script language="javascript"> <!-- function BrowserV(Netscape, Explorer) { if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') || (navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft')) return true; else return false; } // --> </script> <img NAME="startpicture1" SRC="../images/graphisme/fleche1_bleu.jpg" border="0" width="20" height="19"></td> <td><select NAME="menuimage" SIZE="1" onChange="if (BrowserV(3.0,4.0)) startpicture1.src=form.menuimage.options[form.menuimage.selectedIndex].value;"> <option VALUE="../images/graphisme/fleche1_bleu.jpg">Flèche bleu</option> <option VALUE="../images/graphisme/fleche1_jaune.jpg">Flèche jaune</option> <option VALUE="../images/graphisme/fleche1_noir.jpg">Flèche noir</option> </select></td> </tr> </table> </center></div> </form>
Joli effet lors de l'arrivée sur une page
<script language="javascript"> <!-- function makearray(n) { this.length = n; for(var i = 1; i <= n; i++) this[i] = 0; return this; } hexa = new makearray(16); for(var i = 0; i < 10; i++) hexa[i] = i; hexa[10]="a"; hexa[11]="b"; hexa[12]="c"; hexa[13]="d"; hexa[14]="e"; hexa[15]="f"; function hex(i) { if (i < 0) return "00"; else if (i > 255) return "ff"; else return "" + hexa[Math.floor(i/16)] + hexa[i%16]; } function setbgColor(r, g, b) { var hr = hex(r); var hg = hex(g); var hb = hex(b); document.bgColor = "#"+hr+hg+hb; } function fade(sr, sg, sb, er, eg, eb, step) { for(var i = 0; i <= step; i++) { setbgColor( Math.floor(sr * ((step-i)/step) + er * (i/step)), Math.floor(sg * ((step-i)/step) + eg * (i/step)), Math.floor(sb * ((step-i)/step) + eb * (i/step))); } } function fadein() { fade(255,255,255,0,0,0,100); } fadein(); // --> </script>
entre les balises <body> et </body>
OnMouseOver : Bouton qui change au survol de la souris
<script> image1 = new Image(75,17); image1.src = "bouton1.gif"; image2 = new Image(75,17); image2.src = "bouton2.gif"; </script>
<a HREF="http://www.fredd.fr.st" onMouseOver="bouton.src = image2.src" onMouseOut="bouton.src = image1.src"><img SRC="bouton1.gif" NAME="bouton" border="0" width="75" heigth="17"></a>
entre <head> et </head>