voila un petit code que j'ai fais sa tourne bien sous IE mais sous FireFox sa tourne pas
Cordialement Ryodo
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
46
47
48
49
50
51
52
53 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> tamara</TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <BODY> <div style="position = absolute; width:200; height:200; background-color: blue; left:200; top:200; Z-Index:1" onclick="changer1()"> </div> <div style="position = absolute; width:200; height:200; background-color: red; left:300; top:300; Z-Index:2" onclick="changer2()"> </div> </BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- function changer() // genéral { div=document.getElementsByTagName("div") if (div[0].style.zIndex>div[1].style.zIndex) { div[0].style.zIndex=1; div[1].style.zIndex=2; } else { div[0].style.zIndex=2; div[1].style.zIndex=1; } } function changer1() { div=document.getElementsByTagName("div") div[0].style.zIndex=2; div[1].style.zIndex=1; } function changer2() { div=document.getElementsByTagName("div") div[0].style.zIndex=1; div[1].style.zIndex=2; } //--> </SCRIPT> </HTML>
Partager