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 39 40 41 42 43 44 45
| <script type="text/javascript">
function onHeadClick(id) {
document.getElementById('List'+id).style.visibility = 'visible';
}
function onOptionClick(id){
var ListId = id.substring(1,2);
document.getElementById('ListHeader'+ListId).innerHTML = document.getElementById('Item'+id).innerHTML;
document.getElementById('List'+ListId).style.visibility = 'hidden';
}
</script>
</head>
<body>
<div id="Main" style="width:500px;">
<div style="width:250px;float:left;" id="ListHeader1"
onClick="onHeadClick('1');">
<div style="float:left;width:250px;">Sélectionnez</div>
</div>
<div style="width:250px;float:left;" id="ListHeader2"
onClick="onHeadClick('2');">
<div style="float:left;width:250px;">Sélectionnez</div>
</div>
<div style="width:250px;float:left;visibility:hidden;" id="List1">
<div style="float:left;width:250px;" id="Item11"
onClick="onOptionClick('11');">Choix 1</div>
<div style="float:left;width:250px;" id="Item21"
onClick="onOptionClick('21');">Choix 2</div>
<div style="float:left;width:250px;" id="Item31"
onClick="onOptionClick('31');">Choix 3</div>
<div style="float:left;width:250px;" id="Item41"
onClick="onOptionClick('41');">Choix 4</div>
<div style="float:left;width:250px;" id="Item51"
onClick="onOptionClick('51');">Choix 5</div>
</div>
<div style="width:250px;float:left;visibility:hidden;" id="List2">
<div style="float:left;width:250px;" id="Item12"
onClick="onOptionClick('12');">Choix 1</div>
<div style="float:left;width:250px;" id="Item22"
onClick="onOptionClick('22');">Choix 2</div>
<div style="float:left;width:250px;" id="Item32"
onClick="onOptionClick('32');">Choix 3</div>
<div style="float:left;width:250px;" id="Item42"
onClick="onOptionClick('42');">Choix 4</div>
</div>
</div>
</body> |
Partager