<SCRIPT LANGUAGE="JavaScript">
<!--
function cc(o)
{
a = window.open("","_blank","width=" + o.width + ",height=" + o.height);
a.document.write("<html><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0><img src=" + o.src + "></body><html>");
a.document.close();
}
//-->
</SCRIPT>
<img src="http://community.csdn.net/ADV/Images/csdn120x360.GIF" id=aa onclick="cc(this)">
<!--
function cc(o)
{
a = window.open("","_blank","width=" + o.width + ",height=" + o.height);
a.document.write("<html><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0><img src=" + o.src + "></body><html>");
a.document.close();
}
//-->
</SCRIPT>
<img src="http://community.csdn.net/ADV/Images/csdn120x360.GIF" id=aa onclick="cc(this)">
<img src="pic/20041228224912.gif" width="640" height="480">
</body>通通搞成 640*480 了。
var img=null;
function zhiin(url)
{
if(img) img.removeNode(true);
img=document.createElement("img");
img.style.position="absolute";
img.style.visibility="hidden";
img.attachEvent("onreadystatechange",orsc);
img.attachEvent("onerror",oe);
document.body.insertAdjacentElement("beforeend",img);
img.src=url;
}
function oe()
{
alert("cant load img");
}
function orsc()
{
if(img.readyState!="complete")return false;
oWin = window.open("about:blank","","width="+img.offsetWidth+",height="+img.offsetHeight);
oWin.document.write("<html><head><title>zhiin.net</title><style>body{margin:0px}</style></head><body><img src="+img.src+"></body></html>") ;}
</script><button onclick="zhiin('http://community.csdn.net/ADV/Images/csdn120x360.GIF')">open image</button>
<img src="61.jpg" name="aaa" width="800" height="600">
<script language="JavaScript">
window.resizeTo(aaa.width,aaa.height)
</script>
</body>