Avant ce we qui s'annonce plein de bon temps 8)
la reflexion nous est salutaire.
Alors voila mon probleme, j'ai un en-tete de page web developpée en php qui me permet d'écriire toutes les balises du header et qui m'affiche dans un tableau un menu.
un bouton = une case <td></td>
je souhaitais donc a partir de deux images afficher soit un background-image en relief positif (=bouton en haut) soit un relief negatif (=bouton non-selectionné ou en bas).
Mais impossible que ca marche : comment faire?????
voila mon code :
Code : Tout sélectionner
function HH_swapImage()
{
//XXX ATTENTION XXX
// nvelle fonctions dev par Moi le 13/07/06
//
document.getElementById("btn").style.background-image.location="btn_mouseout.gif";
//this.style.background-image="url('img/btn_mouseover.gif')";
}
function HH_swapImgRestore()
{
//this.style.background-image="url('img/btn_mouseout.gif')";
document.getElementById("btn").style.background-image.location="btn_mouseout.gif";
//fin
}
Code : Tout sélectionner
echo '<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="19"><img src="../img/menu_gauche.gif" width="19" height="30"></td>';
//boucle sur tous les records
for($i=0; $i<count($rubriques); $i++)
{
?>
<td width="3"><img src="../img/entredeux.gif" width="3" height="30"></td>
<td id="btn" class="barre_rubrique" onMouseOut="this.style.cursor='default';HH_swapImgRestore();" onMouseOver="this.style.cursor='pointer';HH_swapImage();"> <?php echo $rubriques[$i]['linkname']?> </td>
<?php
}
echo '<td width="3"><img src="../img/entredeux.gif" width="3" height="30"></td>';
echo ' <td width="20"><img src="../img/menu_droite.gif" width="20" height="30"></td>
</tr>
</table>';
Je suis pas pro javascript alors merci aux généreux et talentueux senpai qui liront ce message et m'aideront.