Code java script

Résolu
gaya_102 -  
 gaya_102 -
Bonjour,
voila mon code pour faire un rollover sur mon image mais ca ne marche toujours pas. Je ne vois plus mon image

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>index emiline</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="Exemple" href="design_emeline4.css" />
<!-- DEBUT DU SCRIPT -->
<SCRIPT LANGUAGE="JavaScript">
function rollover {
var img = document.getElementById("id_presentation");
if(img.src == "image/presentation_on") {
img.src = "images/presentation_off";
} else {
img.src = "image/presentation_on";
}
}
</SCRIPT>
<!-- FIN DU SCRIPT -->

</head>

<body>


<!-- fond -->

<div id="unite">
<div class="en_tete">
<img src="image/bande_haut_index.jpg">
</div>
<div class="menu">
<img src="image/gauche_bouton.jpg">



<img src="images/presentation_off" id="id_presentation" onmouseover="rollover()" onmouseout="rollover()" />


<img src="image/jourj_off.jpg">
<img src="image/infos_pratiques_off.jpg">
<img src="image/contact_off.jpg">
<img src="image/droite_bouton.jpg">

</div>
<div class="bas_page">
<img src="image/bande_bas_index.jpg">
</div>
</div>


</body>
</html>


sinon la page c'est

http://www.sandrineetgwen.fr/emeline4.html

Le problème vient d'ou?
merci d'avance
A voir également:

2 réponses

jona303 Messages postés 369 Date d'inscription   Statut Membre Dernière intervention   28
 
function rollover ( ) {
var img = document.getElementById("id_presentation");
if(img.src == "image/presentation_on") {
img.src = "images/presentation_off";
} else {
img.src = "image/presentation_on";
}
}


<img src="images/presentation_off" id="id_presentation" onmouseover="javascript:rollover();" onmouseout="javascript:rollover();" />
je sais pas si c'était ca ton problème, en tous cas c'est plus propre comme ça.. :)
0
N@th@ Messages postés 97 Date d'inscription   Statut Membre Dernière intervention   12
 
Je ne comprend pas pourquoi tu fait deux topic. Après mettre longtemps casser la tête dessus, j'ai trouver le problème qui vient du fait que tu à oublier l'extension à tes images (.jpg)
0
gaya_102
 
oui je viens de le voir en fait voyant que ca ne marchais pas première fois j'ai essayé autre chose
0
gaya_102
 
en tout cas je te remercie de ton aide
0