Version compl�te: jsB@nk » Form » Button » Variante Destination Button
URL: https://www.javascriptbank.com/varying-destination-button.html
Utile si vous n'avez pas beaucoup d'espace pour jouer. Ce script fonctionne presque dans Netscape 2.x: le bouton apparaît et la destination des cycles, donc de cliquer sur le bouton vous amènera à la destination. Malheureusement, la destination ne figure pas sur le bouton: il montre '() lineText' à la place.
Version compl�te: jsB@nk » Form » Button » Variante Destination Button
URL: https://www.javascriptbank.com/varying-destination-button.html
<SCRIPT language=JavaScript> <!-- //author: [email protected] var timerID = null var timerRunning = false var charNo = 0 var charMax = 0 var lineNo = 0 var lineMax = 3 var lineArr = new Array(lineMax) var urlArr = new Array(lineMax) lineArr[1] = "Home Page" urlArr[1] = "http://javascriptbank.com" lineArr[2] = "Site # 1" urlArr[2] = "http://javascriptbank.com" lineArr[3] = "Site # 2" urlArr[3] = "http://javascriptbank.com" var lineText = lineArr[1] function StartShow() { StopShow() ShowLine() timerRunning = true } function FillSpaces() { for (var i = 1; i <= lineWidth; i++) { spaces += " " } } function StopShow() { if (timerRunning) { clearTimeout(timerID) timerRunning = false } } function ShowLine() { if (charNo == 0) { // Next line if (lineNo < lineMax) { lineNo++ } else { lineNo = 1 } lineText = lineArr[lineNo] charMax = lineText.length } if (charNo <= charMax) { // Next char document.formDisplay.buttonFace.value = lineText.substring(0, charNo) charNo++ timerID = setTimeout("ShowLine()", 100) } else { charNo = 0 timerID = setTimeout("ShowLine()", 3000) } } function GotoUrl(url) { top.location.href = url } //--> </SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<SCRIPT language=JavaScript> <!-- document.write("<form name='formDisplay'>"); document.write("<input type='button' name='buttonFace' value='&{lineText}' size=18 onClick='GotoUrl(urlArr[lineNo])'>"); document.write("</form>"); StartShow(); //--> </SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->