function resizeImage(image,width,height)
{
var w = image.width;
var h = image.height;
if(w>width && w>h){
 image.width=width;
 image.height = parseInt(h*(width/w));
 }
 if(h>height && h>w){
 image.width = parseInt(w*(height/h));
 image.height = height;
 }
}
 <%Response.Write "<div style='float:left;width:160px;height=290px;text-align:left;margin-right: 2px;margin-top: 10px;'><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td width=100% height=59 align=center valign=middle><table width=0 border=1 cellpadding=0 cellspacing=2 bordercolor=999999 bgcolor=#FFFFFF><tr><td align=center width=150 height=150><A HREF='Products.asp?Id=" & Rs_Manage("Products_Id") & "' title='产品名称:" & Rs_Manage("Products_Name") & "
产品编号:" & Rs_Manage("Products_Code") & "
添加时间:" & YearDa(Rs_Manage("Products_Date")) & "'><IMG SRC=" & Rs_Manage("Products_Pic") & "  BORDER=0  onload=""resizeImage(this,150,150);""></A></td></tr></table></td></tr><tr><td height=60 align=center valign=middle><A HREF='Products.asp?Id=" & Rs_Manage("Products_Id") & "' title='产品名称:" & Rs_Manage("Products_Name") & "
产品编号:" & Rs_Manage("Products_Code") & "
添加时间:" & YearDa(Rs_Manage("Products_Date")) & "'><b>" & gotTopic(Rs_Manage("Products_Name"),19,1) & "</b></A><br>作者:"& Rs_Manage("Products_Model") &"<br>尺寸:"& Rs_Manage("Products_Specification") &"<br><span style=text-decoration: line-through;>市场价:"& Rs_Manage("A1") &" 元</span><br><span style=""font-weight: bold; color: #FF0000"">会员价:"& Rs_Manage("Products_Money") &" 元</span></td></tr></table></div>" 
%>
图片不能显示150,150的固定大小,onload=""resizeImage(this,150,150);""觉得这句格式不太对,尤其是引号,但是怎么改都不对,到底应该怎么写?

解决方案 »

  1.   

    onload=""resizeImage(this,150,150);""觉得这句格式不太对,尤其是引号
    ------
    你根本不是写后台的吧.这个问题似乎也不适合你来处理,让别人做吧.要想做的话,自己有空看看后台基础书.
      

  2.   

    问题是在前面的部分里:
    function resizeImage(image,width,height)
    {
     image.width=width;
     image.height = height;
    }
    这样就是你想要的了.
    不过,这样勉为其难的任务,你还是应该学会拒绝,否则会很麻烦.