[javascript] problème insertion image
Bonjour,
J'ai une fonction qui insère une image à un endroit précis par dessus une autre image.
A la main ca fonctionne bien, mais lorsque j'utilise une fonction javascript, cela affiche l'image dans une page blanche...
Voici le code que j'utilise:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<div class="mapEurope">
<img src="map.jpg" usemap="#mailles" border="0">
<map name="mailles">
<area shape="rect" href="#" onclick="setIdSite(46042); markArea(218,332);" coords=218,332,229,343>
<area shape="rect" href="#" onclick="setIdSite(46043);" coords=231,332,241,343>
<area shape="rect" href="#" onclick="setIdSite(45043);" coords=231,345,241,355>
<area shape="rect" href="#" onclick="setIdSite(45044);" coords=243,345,254,355>
<area shape="rect" href="#" onclick="setIdSite(44044);" coords=243,357,254,368>
<area shape="rect" href="#" onclick="setIdSite(44046);" coords=268,357,278,368>
<area shape="rect" href="#" onclick="setIdSite(44050);" coords=318,357,328,368>
<area shape="rect" href="#" onclick="setIdSite(44051);" coords=330,357,341,368>
</map>
</img> |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
function markArea(abs,ord){
switch (lastFocus)
{
case '1':
this.document.write('<img style="position: absolute; top:ord; left:abs;" src="redPoint3.gif" border="0" />');
break;
...
default:
this.document.write('<img style="position: absolute; top:ord; left:abs;" src="redPoint3.gif" border="0" />');
break;
}
} |
J'ai regardé un script d'affichage aléatoire d'images, il n'est pas censé afficher dans une page blanche ??
Une idée ?
Merci de votre aide ;)