你自己显示的时候,设置过Width什么吗?

解决方案 »

  1.   

    n = document.all.length
    for (i=1;i<n;i++)
    {
      if(document.all[i].tagName == "IMG")
      {
        if (document.all[i].width > 560 || document.all[i].height > 500)
        {
          document.all[i].width = 560;
          document.all[i].height = 500;
        }
      }
    }
      

  2.   

    <script language="javascript">
    attachEvent ('onload', init_IMG);
    function init_IMG()
    {
    n = document.all.length;
    for (i=1;i<n;i++)
    {
    if(document.all[i].tagName == "IMG")
    {
    if (document.all[i].width > 560 || document.all[i].height > 500)
    {
    document.all[i].width = 560;
    document.all[i].height = 500;
    }
    }
    }
    }
    </script>将此代码块放在页面中任何位置即可
      

  3.   

    <img>标签有onload属性
    <img src="" onload="init_IMG(this)">
    加这个应该不困难吧,估计你的图片都是程序
    这样只任何一幅图片下载完成就开始进行转换,不用等到整个页面都下载完才转换
    当然init_IMG()函数要改一下
    function init_IMG(t)
    { if (twidth > 560 || t.height > 500)
    {
    t.width = 560;
    t.height = 500;
    }
    }
      

  4.   

    图片的onload是要图片下载完成才触发的。我用的就是onload,图全打开了才会转换。