先将以下JS代码放入HTML文件
<SCRIPT> var imgObj; function checkImg(theURL,winName){ if (typeof(imgObj) == "object"){ if ((imgObj.width != 0) && (imgObj.height != 0)) OpenFullSizeWindow(theURL,winName, imgObj.width,imgObj.height); else setTimeout("checkImg('" + theURL + "','" + winName + "')", 100) } } function OpenFullSizeWindow(theURL,winName,width,height) { var aNewWin, sBaseCmd; sBaseCmd = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2)+","; if (width == null || width == ""){ imgObj = new Image(); imgObj.src = theURL; checkImg(theURL, winName) }else{ newwin=window.open('about:blank','',sBaseCmd+'width='+width+',height='+height); newwin.document.write('<body leftmargin=0 topmargin=0><img id="img1" src='+theURL+'>'); newwin.focus(); } } </SCRIPT>
用以下代码在FLASH按钮中调用就可以了
on(release){ getURL("javascript:OpenFullSizeWindow('images/sh2br-bath.jpg')"); }





评论