Code LES BOUTONS WINDOW HoSaM 9:07 AM Code LES BOUTONS WINDOW <br /> <!-- DEUX ETAPES D'INSTALLER les bouttons window : --><br /> <br /> <!-- ETAPE 1: INSEREZ LE CODE 1 ENTRE LES BALISES <HEAD>..</HEAD> DU DOCUMENT --><br /> <br /> <HEAD><br /> <br /> <SCRIPT LANGUAGE="JavaScript"> <!-- Ce script et d'autres sont sur le code java - GRATUIT --> <!-- le code java - http://www.lecodejava.com --> <!-- Begin var button = new Array(); var action = new Array(); var buttonWidth = new Array(); button[1] = 'Metter <u>U</u>RL de votre site'; buttonWidth[1] = 150; action[1] = function () { window.open('http://lecodejava.com'); } button[2] = 'Suscribe to our <u>n</u>ewsletter'; buttonWidth[2] = 150; //This is the button's width, in pixels. action[2] = function () { // Place here you actions for button 1: window.open('http://javascript.internet.com'); // End of actions for button 1. } button[3] = '<u>C</u>heck your mail at yahoo.com'; buttonWidth[3] = 150; //This is the button's width, in pixels. action[3] = function () { // Place here you actions for button 1: window.open('http://javascripts.com'); // End of actions for button 1. } button[4] = 'Tel<u>l</u> a friend'; buttonWidth[4] = 150; //This is the button's width, in pixels. action[4] = function () { // Place here you actions for button 1: window.open('http://javascript.internet.com'); // End of actions for button 1. } button[5] = 'View <u>s</u>ource code'; buttonWidth[5] = 150; //This is the button's width, in pixels. action[5] = function () { // Place here you actions for button 1: location.href='view-source:http://javascript.internet.com'; // End of actions for button 1. } // END OF EDITABLE SECTION // // Don't edit bellow or you could get errors! // function placeButton(value) { if (button[value]) { if (button[value].indexOf('<u>') != -1) { document.write('<button id="b'+value+'" style="Width : '+buttonWidth[value]+'px ; Height : 22px" onClick="action['+value+']()"><font face="MS Sans Serif" size="1">'+button[value]+'</button>'); } else { alert('You didn\'t specify the underlined letter for the button number '+value+'. This button cannot be placed until you specify the underlined letter by using <u> and </u> tags.'); } } else { alert('You are trying to place the button number '+value+', but you didn\'t declare its values on the variables area. \r\rThe button '+value+' will not be placed until you specify the variables "button['+value+']" and "action['+value+']".'); } } document.write('<script'+'>'); document.write('function myfocus(n) {'); for (a=1; a<button.length; a++) { document.write('if (n=='+a+') {document.all.b'+a+'.focus()}'); } document.write('}'); document.write('<'+'/script>'); function chkKey(evt) { var mykey, alt, ctrl, shift; if (window.Event) { mykey = evt.which; alt = (evt.modifiers & Event.ALT_MASK) ? true : false; ctrl = (evt.modifiers & Event.CONTROL_MASK) ? true : false; shift = (evt.modifiers & Event.SHIFT_MASK) ? true : false; } else { mykey = evt.keyCode; alt = evt.altKey; ctrl = evt.ctrlKey; shift = evt.shiftKey; } if (mykey!=0 && mykey!=16 && mykey!=17 && mykey!=18) { if (alt) { for (i=1; i<button.length; i++) { ui = button[i].indexOf('<u>'); ul = button[i].substring(ui + 3, ui + 4).toLowerCase(); if (String.fromCharCode(mykey).toLowerCase() == ul) { myfocus(i); action[i](); break; } } } } return true; } if (window.Event) { document.captureEvents(Event.KEYDOWN); document.onkeydown = chkKey; } else { document.onkeydown = function() { return chkKey(event); } } // End --> </script><br /> <br /> </HEAD><br /> <br /> <!-- ETAPE 2 : INSEREZ LE CODE 2 ENTRE LES BALISES <BODY>..</BODY> DU DOCUMENT --><br /> <br /> <BODY><br /> <br /> <br /> <script>placeButton(1)</script> <br><br /> <script>placeButton(2)</script> <br><br /> <script>placeButton(3)</script> <br><br /> <script>placeButton(4)</script> <br><br /> <script>placeButton(5)</script> <br><br /> <br /> <br /> <br /> <br /> <br /> <br /> ÔÇÑß ÇáãæÖæÚ: Codes Related Posts