riki a ecrit :
yes, but now i have to manualy insert width and height in the
pop(width,height) function and i would like something like this if it is
possible
onclick="pop(getImage[imgPath/imgName].getWidth,
getImage[imgPath/imgName].getHeight);">Image 1</a>
<SCRIPT LANGUAGE="JavaScript">
/*
SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
http://www.editeurjavascript.com
Ne copiez ce code qu'une fois dans votre page
Copy this code only once in your page
*/
function afficheVignette(cheminVignette,cheminMaxi)
{
document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+
'\')"><IMG SRC="'+cheminVignette+
'" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour voir en grand"></A>');
}
function afficheMaxi(chemin) // chemin = path to big photo file
{
i1 = new Image;
i1.src = chemin;
html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD>'+
'<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>'+
'<CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="'+
window.resizeTo(document.imageTest.width,document.imageTest.height)">'+
'</CENTER></BODY></HTML>';
popupImage = window.open('','_blank','menuBar=0,scrollbars=0,resizable=1');
popupImage.document.open();
popupImage.document.write(html);
popupImage.document.close()
};
</SCRIPT>
To use this script :
insert in your page each time there where you need an image "zoommable"
<p><SCRIPT LANGUAGE="JavaScript">
affiche('path_thumbnails/Img1.jpg','path_tall_Photos/Img1.jpg');
</script>
<p><SCRIPT LANGUAGE="JavaScript">
affiche('path_thumbnails/Img2.jpg','path_tall_Photos/Img2.jpg');
</script>
could be replaced by :
<A HREF="javascript:afficheMaxi('path_big_Photos/Img1.jpg');
"><IMG SRC="path_thumbnails/Img1.jpg" HSPACE=0 VSPACE=0 BORDER=0
ALT="Clicable picture" TITLE="Click me to see me in tall"></A>
<A HREF="javascript:afficheMaxi('path_big_Photos/Img2.jpg');
"><IMG SRC="path_thumbnails/Img2.jpg" HSPACE=0 VSPACE=0 BORDER=0
ALT="Clicable picture" TITLE="Click me to see me in big"></A>
You probably will have to adapte to be compatible with DOM
--
**************************************************************
Stéphane MORIAUX : mailto:
[email protected]
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
**************************************************************