Bonjour à tous,

Alors voila, j'ai un script qui me permet d'afficher une image quand la souris passe sur le lien. Le script est le suivant :

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
 
<SCRIPT type="text/javascript">
if (document.getElementById){
box = document.getElementById("img").style;
if(navigator.appName.substring(0,3) == "Net")
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = pointer;
}
function poplink(contenu){
var content ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000><TR><TD><TABLE WIDTH=1 CELLPADDING=3 CELLSPACING=1><TR><TD BGCOLOR=#FFFFFF><CENTER>"+contenu+"</CENTER></TD></TR></TABLE></TD></TR></TABLE>";
if (document.getElementById)
{
document.getElementById("img").innerHTML =
content;
box.visibility = "visible";
}
}
function pointer(e)
{
var x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
var y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
box.left = x+2;
box.top = y+2;
}
function closepopup()
{
if (document.getElementById)
box.visibility = "hidden";
}
</SCRIPT>
Ma question est la suivante : Comment faire en sorte que l'image qui apparait soit toujours au centre de l'ecran même quand le lien se trouve au bord de l'ecran ?

Bien cordialement à tous