Code : Tout sélectionner
<SCRIPT TYPE='text/javascript'>
<!--
<!-- cette fonction détemine la position du popup -->
function popup(width,height){
if(window.innerWidth){
LeftPosition =(window.innerWidth-width)/2;
TopPosition =((window.innerHeight-height)/4)-50;
}
else{
LeftPosition =(parseInt(window.screen.width)-width)/2;
TopPosition=((parseInt(window.screen.height)-height)/2)-50;
}
//le pop up accepte les scrolls mais n'est pas redimentionable
attr = 'resizable=no,scrollbars=yes,location=yes,width=' + width + ',height=' +
height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
TopPosition + '';
//variable d'ouverture
popWin=open('', 'new_window', attr);
//-->
</SCRIPT>
Code : Tout sélectionner
<div id="flyer">
<a href="zoomproduit.php" onclick="popup(this.href);return false;" target="popWin">
<img src="<?php echo 'photo: '.$ligne['vignette'] ?>" />
</a></div>
</div>