1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <script type="text/javascript">
//Construction du compteur
var valeur_origine = 100;
var valeur = valeur_origine
var x;
function Init() {
window.document.getElementById('compteur').value=valeur;
x = window.setInterval('Decompte()', 100);
}
//Demarrage quand un choix est fait selected"
function Decompte() {
((valeur > 0)&&( ! window.document.getElementById('select1').selected)) ? (window.document.getElementById('compteur').value = --valeur) : (window.clearInterval(x));
}
//Remise à zéro si changement de choix
var current = 0;
function change(what)
{
document.getElementById("diffchoix").src = Init;
}
window.onload = Init;
</script>
<body>
<div id="choix">
<div class="styled-select"><select name="select1" id="select1" onchange="Relance(this)">
<option value="0" selected="selected"></option>
<option value="1" >Agen</option>
<option value="2">Marmande</option>
<option value="3">Nerac</option>
</select></div>
</div>
<div id="textcompteur"><input type="text" name="compteur" id="compteur" class="textcompteur" size="3" readonly="readonly"></div>
</body> |
Partager