<img src="1.jpg">当这个图片的宽度大于浏览器的时候浏览器就自动将我的图片缩小了,我不想要怎么办如
<img src='1.jpg' alt='' />
当我的图片的宽度为2000这么大的时候
浏览器就自动将他缩小浏览器的适应大小
要怎么办

解决方案 »

  1.   

    <img src='1.jpg' alt='' height="768" width="1024"/>
    Height图片高度
    width图片宽度;
      

  2.   

    指定大小.style="width:??;height:???
      

  3.   

    <img> 里 把 width 和 height 写死
      

  4.   

    只要 你指定image的  width 和 height 的值就可以避免你遇到的问题!
      

  5.   

    向上面各位说的,把图片大小指定,如果要宽度不变,高度变的话就只指定width
      

  6.   

    当这个图片的宽度大于浏览器的时候浏览器就自动将我的图片缩小了?
    应该是
    IE设置自动 缩小那么打开IE 设置  高级 启用自动图像大小调整 去掉! 即可如不是 可写死width height
      

  7.   

    楼主好象不是这个意思 
    我替楼主说明一下
    他的图片应该是不固定的 
    有时候小于浏览器宽度 如 width:200px 应200px显示
    大于浏览器宽度时候 如 2000px 也应按实际宽度显示 2000px如果设置固定宽度的话 就把小于2000px的图片拉伸了 可以动态给IMG的width 和 height赋值
      

  8.   

    对IE说:"不要......":D,开个玩笑
    用一个Image对像读到图片的W H,然后设置<img 的 W H
      

  9.   

    xinfan(新凡) 
    说得对,在动态获取图片src的时候就顺便把height和width也动态赋值
      

  10.   

    只要指定img样式里面的width和height就可以了嘛
      

  11.   

    <body style="margin:0;overflow:hidden">
    <img onload="if(this.width>document.body.offsetWidth) this.width=document.body.offsetWidth" src="http://www.phonk.net/Images/Cap-d-Ail/small/010825-Cap-d-Ail.jpg">
    z注意20px的滚动条
      

  12.   

    //图片按比例缩放,可输入参数设定初始大小
    function resizeimg(ImgD,iwidth,iheight) {
         var image=new Image();
         image.src=../../ImgD.src;
         if(image.width>0 && image.height>0){
            if(image.width/image.height>= iwidth/iheight){
               if(image.width>iwidth){
                   ImgD.width=iwidth;
                   ImgD.height=(image.height*iwidth)/image.width;
               }else{
                      ImgD.width=image.width;
                      ImgD.height=image.height;
                    }
                   ImgD.alt=image.width+"×"+image.height;
            }
            else{
                    if(image.height>iheight){
                           ImgD.height=iheight;
                           ImgD.width=(image.width*iheight)/image.height;
                    }else{
                            ImgD.width=image.width;
                            ImgD.height=image.height;
                         }
                    ImgD.alt=image.width+"×"+image.height;
                }
         ImgD.style.cursor= "pointer"; //改变鼠标指针
         ImgD.onclick = function() { window.open(this.src);} //点击打开大图片
        if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) { //判断浏览器,如果是IE
          ImgD.title = "请使用鼠标滚轮缩放图片,点击图片可在新窗口打开";
          ImgD.onmousewheel = function img_zoom() //滚轮缩放
          {
              var zoom = parseInt(this.style.zoom, 10) || 100;
              zoom += event.wheelDelta / 12;
              if (zoom> 0) this.style.zoom = zoom + "%";
              return false;
          }
         } else { //如果不是IE
                ImgD.title = "点击图片可在新窗口打开";
             }
        }
    }具体实现代码如下:<img name="" src=http://www.webjx.com/htmldata/2006-07-30/"" onload="javascript:resizeimg(this,100,200)">
      

  13.   

    没分了,也说一下,就像缩略图式的width,height动态获得