Bonjour !
J'ai trouvé un petit truc quelque part, je ne comprends pas pourquoi ça ne marche pas. Quelqu'un pourrait-il m'aider ?
Dans le template du blog, j'ai mis ceci :
1 2 3 4 5 6 7 8 9 10 11 12
| <script type='text/Javascript'>
function PopImg(img) {
image = new Image();
image.src = img;
lmax=screen.width-50;
html = '<HTML><HEAD><TITLE>Image</TITLE></HEAD><BODY style='margin:0;'><IMG NAME='imageTest' SRC='"+img+"' onLoad='lmax=screen.width-50;hmax=screen.height-50;i=document.imageTest;l=i.width;h=i.height;if(l>=lmax){h=(lmax/l)*h;l=lmax};if(h>=hmax)h=hmax;window.resizeTo(l,h);moveTo((lmax-l)/2,0)' onclick='window.close()' style='max-width:"+lmax+"'/></BODY></HTML>';
popupImage = window.open('','','width=200+"px",height=200+"px",scrollbars=no,resizable,status=no');
popupImage.document.open();
popupImage.document.write(html);
popupImage.document.close();
}
</script> |
Puis dans l'article que je souhaite publier, j'ai mis ceci :
<a href="javascript: PopImg('http://.............jpg')"><img src="http://......idem......jpg" alt="" align="center" style="display: block; text-align: center; cursor: pointer;" title="Cliquer pour fermer"></a>
Résultat : l'image ne s'affiche pas dans le cadre prévu et rien ne se passe si on clique dessus...
Quelqu'un pourrait-il m'aider s'il-vous-plaît ?
Merci beaucoup
Partager