Bonjour,

Voici mon code HTML :
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
<script language="javascript">
var arg2=""
function showMenu() {
with(document.getElementById(arg2).style) {
visibility = "visible"
left = event.x+"px"
top = event.y+"px"
}
return false; 
}
function hideMenu() {
with(document.getElementById(arg2).style) {
visibility = "hidden" 
}
 
}
contextMenu = new Object()
contextMenu.applyStyle = function(arg1) {
with(document.getElementById(arg1).style) {
borderWidth = "2px"
borderStyle = "outset"
backgroundColor = "#D4D0C8"
fontFamily = "Tahoma"
fontSize = "8pt" 
visibility = "hidden"
position = "absolute"
}
arg2 = arg1
document.oncontextmenu = showMenu
document.onclick = hideMenu
}
contextMenu.newRow = function(nb, val, go2W) {
document.write("<span id=\"row"+nb+"\" onmouseover=\"this.style.backgroundColor='#0A246A'; this.style.color='white'\" onmouseout=\"this.style.backgroundColor='#D4D0C8'; this.style.color='black'\" onclick='location.href=\""+go2W+"\"'>"+val+"</span><br>")
}
contextMenu.initialize = function (nm) {
document.write('<span id="'+nm+'">') }
contextMenu.end = function () {
document.write("</span>")
}
</script>
<body onload="contextMenu.applyStyle('context1')">
<script language="javascript">
contextMenu.initialize("context1")
contextMenu.newRow(1,"Hi1fggggg", "http://www.google.com")
contextMenu.newRow(2,"Hi2")
contextMenu.newRow(3,"Hi3")
contextMenu.end()
</script>
</body>
Mon probleme est que, quand vous cliquez droit sur la page, le menu s'affiche, mais si vous passez la souris sur le premier objet, la ligne devient bleue, mais si vous passez sur le deuxieme, seulement le texte devient bleu.
Y'a-t-il une solution pour surligner toute la ligne? Merci

P.S. : J'ai deja essaye de mettre un tableau, le probleme est qu'il m'affiche une ligne en trop.