









Voici une function javascript qui ouvrira un popup adapté à une image donnée.
function popupImg(chemin,titre){ html = '<html><head><title>'+titre+'</title></head><body onblur="self.close()" style="margin:0;"><img id="myImg" src="'+chemin+'" onload="window.resizeTo(document.getElementById(\'myImg\').width+10, document.getElementById(\'myImg\').height+30)"></body></html>'; popupImage =window.open('','_blank','toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=1'); popupImage.document.open(); popupImage.document.write(html); popupImage.document.close(); }
Chemin est le chemin vers votre image et titre est le titre donné au popup.
Discussion