<script>
function displayPics()
{
var photos = document.getElementById('galerie_mini') ;
// On récupère l'élément ayant pour id galerie_mini
var liens = photos.getElementsByTagName('a') ;
// On récupère dans une variable tous les liens contenu dans galerie_mini
var big_photo = document.getElementById('big_pict') ;
// Ici c'est l'élément ayant pour id big_pict qui est récupéré, c'est notre photo en taille normale
// Une boucle parcourant l'ensemble des liens contenu dans galerie_mini
for (var i = 0 ; i < liens.length ; ++i) {
// Au clique sur ces liens
liens[i].onclick = function() {
big_photo.src = this.href; // On change l'attribut src de l'image en le remplaçant par la valeur du lien
big_photo.alt = this.title; // On change son titre
return false; // Et pour finir on inhibe l'action réelle du lien
};
}
}
window.onload = displayPics;
// Il ne reste plus qu'à appeler notre fonction au chargement de la page
</script>
<script>
function popup(obj)
{
var big_image = obj.src;
window.open('images/max_'+big_image);
}
</script>
et mon affichage: <dl id="photo">
<dt>
<div align="center">
<table width="195" border="0" align="center" cellspacing="0">
<tr>
<td><div align="center"><img id="big_pict" src="images/<?php echo $row_livre['photo1p']; ?>" width="190" height="190" border="1" onclick="popup(this)"></a></div></td>
</tr>
</table>
</div>
</dt>
<ul id="galerie_mini">
<table width="180" border="0" align="center" cellspacing="0">
<tr>
<td><div align="center"><a href="images/<?php echo $row_livre['photo1p']; ?>"><img src="images/<?php echo $row_livre['photo1p']; ?>" width="60" height="60" border="1"></a></div></td>
<td><div align="center"><a href="images/<?php echo $row_livre['photo2p']; ?>"><img src="images/<?php echo $row_livre['photo2p']; ?>" width="60" height="60" border="1"></a></div></td>
<td><div align="center"><a href="images/<?php echo $row_livre['photo3p']; ?>"><img src="images/<?php echo $row_livre['photo3p']; ?>" width="60" height="60" border="1"></a></div></td>
</tr>
</table>
</ul>
alert(big_image);
tu vera le pourquoi du comment.var big_image = obj.src;
image = big_image.split('/');
window.open('images/max_'+image[1]);
Bon ce n'est optimisé que pour le cas ou le chemin comporte un seul "/" ce qui est ton cas.