先用hidden存好没有缩小的width,height

解决方案 »

  1.   

    offset和img.width,看示例
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title> - http://www.never-online.net </title>
        <meta http-equiv="ImageToolbar" content="no" />
        <meta name="author" content="never-online, BlueDestiny"/>
      </head>
      <body id="www.never-online.net">
    <img src="http://zi.csdn.net/ren760-ok_3.gif" id="p" style="border:2px solid #000" onload="loadp(this)"/>
        <script type="text/javascript">
        //<![CDATA[
    function loadp(img) {
    var w=img.width;
    var h=img.height;var w2=img.offsetWidth;
    var h2=img.offsetHeight;
    alert("offset:"+w2)
    alert("img"+w)
    }
        //]]>
        </script>
      </body>
    </html>
      

  2.   

    如果这个200*200的图片被zoom{zoom:0.75}缩放用DOM取得此图片的zoom值(object.style.zoom)再用img.width*zoom值即可
      

  3.   

    <img src="....." onload="loadimg(this)"/>
        <script type="text/javascript">
    function loadimg(theimg) {
    var image=new Image();
    image.src=theimg.src;
    //image.width>0,image.height既为原图尺寸
    alert(image.width);
    alert(image.height);
    }
         </script>
      

  4.   

    <img src="....." onload="loadimg(this)"/>
        <script type="text/javascript">
    function loadimg(theimg) {
    var image=new Image();
    image.src=theimg.src;
    //image.width,image.height既为原图尺寸
    alert(image.width);
    alert(image.height);
    }
         </script>