都过中秋去了改了一下:
<img id="ProImg" border=0 src="http://i3.sinaimg.cn/home/deco/2008/0325/sinahome_Logo.gif" onload="javascript:if(this.offsetWidth > 20)this.style.width='20px';">通过了 IE6 和 FF
<img id="ProImg" border=0 src="http://i3.sinaimg.cn/home/deco/2008/0325/sinahome_Logo.gif" onload="javascript:if(this.offsetWidth > 20)this.style.width='20px';">通过了 IE6 和 FF
最好给个测试页
或者试试
setTimeout(function(){
if (theImg.width>18){
theImg.width=18;
} if(theImg.height>20){
theImg.height=20;
} },10)
<table width="878" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="2"></td>
<td width="180" height="179" valign="top" class="TableBorder">
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="0">
<tr><td height="34" class="indexTitleRight">产品列表</td></tr>
<tr><td height="10">
<div align="right"><% =WebMenu("ProductSort",0)%></div>
</td></tr>
</table>
</td>
<td width="10"></td>
<td valign="top" align="center">
<div>
<table width="490" border="0" cellspacing="0" cellpadding="0">
<TR><TD height="1" colspan="3">
<!--广告位-->
<div class="adDiv"><script src="getAd.asp?Type=详细&Type1=产品&AdW=490&AdH=80&Ads=1"></script></div>
</td></tr>
</table>
<!--产品内容-->
<table width="490" border="0" class="TableTriBorder" align="center" cellpadding="5" cellspacing="0" >
<TR>
<TD class=BgRigBotBorder vAlign=center align=middle width=170 rowSpan=9>
<div><img src="<%=rs("DefaultPicUrl")%>" onload="Javascript:javascript:if(this.width>10)this.width=10;"></div> </TD>
<td width="60" align="right" class="BgRigBotBorder">产品编号</td>
<td class="botBorder"><%=rs("Product_Id")%> </td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">产品名称</td>
<td class="botBorder"><%=rs("title")%> </td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">所属类别</td>
<td class="botBorder"><%=rs("ClassName")%> </td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">产品售价</td>
<td class="botBorder">
<%response.write "直销价格:<font color=#0000ff>¥" & rs("NormalPrice") &"</font> 元<br>"%>
</td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">发布日期</td>
<td class="botBorder"><%=rs("AddTime")%> </td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">产品规格</td>
<td class="botBorder"><%=rs("Spec")%> </td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">购买次数</td>
<td class="botBorder"><%=rs("BuyHits")%> 次</td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">点击次数</td>
<td class="botBorder"><%=rs("Hits")%> 次</td>
</tr>
<tr>
<td width="60" align="right" class="BgRigBotBorder">马上购买</td>
<td class="botBorder"><a href="add.asp?product_Id=<%=rs("ID")%>&ProductNum=1" target="_blank"><img src="images/cart.gif"></a></td>
</tr>
</table>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><td height="5"></td></tr>
<tr><td class="indexTitleRight">产品详细参数</td></tr>
<tr><td class="NewsContent"><%=rs("content")%></td></tr>
</table>
</td>
<td width="10"></td>
<td width="200" valign="top">
<!-----此处为影响结果正确的部分------>
<table width="98%" align="right" border="0" cellspacing="1" cellpadding="0">
<tr><td class="indexDiv180">产品购买排行</td></tr>
<tr><td style="height:183px;"><script src="getProduct_top.asp?SA=YES&stime=yes&TLen=12&Num=10"></script></td></tr>
<tr><td style="padding-top:10px;text-align:center;"><script src="getAd.asp?Type=详细&Type1=产品&AdW=170&AdH=150&Ads=2"></script></td></tr>
</table><!-----但是文件上部分也有类似的调用,但是不影响结果,而且经过检查认为此部分的代码也没什么问题------>
</td>
</tr>
</table>
function zoomIt(theImg) {
setTimeout('a=changeSrc(theImg)',200);} function zoomIt(theImg) {
if (theImg.width>18) {
theImg.width=18;
} if(theImg.height>20) {
theImg.height=20;
}
}
</script>
ps:最近一直在看asp.net所以没有上来,拖了很久了,真是抱歉.