<div class="htmlarea"> <textarea id="runcode36033"> <title>在图片上单击获取图片原始大小</title> <img src="http://www.jb51.net/images/logo.gif" style="max-width:90%" style="max-width:90%" onclick="alert('图片原始宽度为:'+GetImageWidth(this)+'\n图片原始高度为:'+GetImageHeight(this))" alt="在图片上单击获取图片原始大小_图象特效" > <script> var OriginImage=new Image(); function GetImageWidth(oImage) { if(OriginImage.src!=oImage.src)OriginImage.src=oImage.src; return OriginImage.width; } function GetImageHeight(oImage) { if(OriginImage.src!=oImage.src)OriginImage.src=oImage.src; return OriginImage.height; } </script> </textarea><br><input onclick="runEx('runcode36033')" type="button" value="运行代码"> <input onclick="doCopy('runcode36033')" type="button" value="复制代码"> <input onclick="doSave(runcode36033)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>