有位朋友给了我一个函数,可我不会用:哈哈  楼上的和我碰到过的情况一样
给你代码吧 废话少说<script language="javascript">
<!--
var flag=false;
function DrawImage(ImgD){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= 524/393){
     if(image.width>524){  
     ImgD.width=524;
     ImgD.height=(image.height*524)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    else{
     if(image.height>393){  
     ImgD.height=393;
     ImgD.width=(image.width*393)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    }

//-->
</script>