106、打开图片的窗口

106、打开图片的窗口

脚本说明:

把如下代码加入<body>区域中

<SCRIPT>

function DynaWin(url, h, w, l, t) {

poph = + h + 70

popw = + w + 30

disp = window.open("","pop","height=" + poph + ",width=" + popw + ",left=" + l + ",top=" + t + "");

content = '<HTML>';

content += '<TITLE>弹出窗口</TITLE>';

content += '</HEAD>';

content += '<BODY BACKGROUND="yourfile" onBlur="self.close()">';

content += '<P ALIGN="CENTER"><img src="path to image' + url + '" height="' + h + '" width="' + w + '"></P>';

content += '<H3 ALIGN="CENTER"><A HREF="#" onClick="self.close()">关闭窗口</A></H3>';

content += '</BODY></HTML>';

disp.document.write(content);

disp.document.close();

}

</SCRIPT>

<A HREF="#" onClick="DynaWin('photo2.jpg', '300', '300', '30', '30')";>打开图片</A>

 

Write a comment

Comments: 0