popup dimensionner qui garde les proportion de l'image
Posté : 28 sept. 2005, 13:50
bonjours a tous j'aimerai que mon popup a qui je donne une taille limite garde les proportion de mon image, merci de votre aide.
Code : Tout sélectionner
<SCRIPT LANGUAGE="JavaScript">
function PopupImage(img) {
titre=":: ZOOM ::";
w=open("",'image','top='+(screen.availHeight/2-200)+',left='+(screen.availWidth/2-200)+',width=250,height=350,toolbar=no,scrollbars=no,resizable=no');
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+5,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
w.document.write("<BODY onload='checksize()' oncontextmenu='return false' ondragstart='return false' onselectstart='return false' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><meta http-equiv=imagetoolbar content=no /><a href='#' onClick='window.close()'><IMG src='"+img+"' border=0' height=350) >");
w.document.write("");
w.document.write("<HTML><BODY onblur=\"window.close();\"><IMG src='"+img+"'>");
w.document.write("</BODY></HTML>");
w.document.close();
}
</SCRIPT>