1.在IE6中这样就可以实现关闭时不弹出提示窗口
window.opener = null;
window.close();
2.在IE7中这样就可以实现关闭时不弹出提示窗口
window.opener=null;

window.open('','_top');
window.top.close();

3.上传图片后得到图片大小及预览
<input type="file" onchange="javascript:Preview(this);" /><br />
<div id="pic" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:400px;height:200px;"></div>
获取图片的大小
var img=new Image();
img.src=imgFile.value;
alert(img.fileSize);
alert(img.width);
alert(img.height);


浏览器窗口关闭与图片预览
本文介绍如何在不同版本的Internet Explorer中实现无提示关闭窗口的方法,并提供了一个使用JavaScript进行图片上传后的尺寸获取与预览的示例。
1900

被折叠的 条评论
为什么被折叠?



