Bonjour,
Un probleme qui a l'air simple. j'ai un DIV et je veux recuperer par $_GET les valeurs du click de ma asouris et l'ID du DIV. Pour le click ca marche mais j'arrive pas a recuperer l'ID du DIV ... Pouvez vous m'aider. Merciiiiiiii
LE JAVASCRIPT
---------------------------------------------
LE DIV
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 <script> function sourisxy(id,e) { id = document.getElementById('id'); x = (navigator.appName=="Netscape") ? e.pageX : event.x + document.body.scrollLeft; y = (navigator.appName=="Netscape") ? e.pageY : event.y + document.body.scrollTop; // alert("x:"+x+" y:"+y); window.location.href="test_tableau.php?x="+x +"&y="+y +"&id="+id; } if(navigator.appName.substring(0,3) == "Net") document.captureEvents(Event.mousemove); document.onclick = sourisxy; </script>
--------------------------------
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 <div id="id1" onclick="sourisxy(id1,e)" style="z-index: 1; margin-left: 0px; margin-top: 0px; opacity: 1; width: 160px; height: 125px; border: 1px dashed #900; background-color: red;position:relative;"> <div id="id2" onclick="sourisxy(id2,e)" style="z-index: 2; margin-left: 0px; margin-top: 0px; opacity: 1; width: 160px; height: 50px; border: 1px dashed #900; background-color: yellow;position:absolute; top:50px;"></div> <div id="id3" onclick="sourisxy(id3,e)" style="z-index: 3; margin-left: 0px; margin-top: 0px; opacity: 1; width: 160px; height: 25px; border: 1px dashed #900; background-color: green;position:absolute;
Partager