请帮帮忙,非常THANKS的啊
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<IMG id=Close_img onClick="this.style.display='none'; Close_text.style.display='none'; Open_img.style.display='inline'; Open_text.style.display='inline';"  alt="点击查看全文" src="http://bbs.dvbbs.net/skins/style_60/plus.gif" width=11 height=11 align=top><!--点击打开文章的图片-->
<IMG id=Open_img style="DISPLAY: none" onClick="this.style.display='none'; Open_text.style.display='none'; Close_img.style.display='inline'; Close_text.style.display='inline';"  alt="点击关闭全文" src="http://bbs.dvbbs.net/Skins/Default/nofollow.gif" width=11 height=11 align=top>
<SPAN id=Close_text >
可以正常缩放图片<br />
<img src="http://www.ali213.net/picfile/News/200909/ps_3.jpg" onload='javascript:if(this.width>200)this.style.width="200px";this.style.height=this.height*(200/this.width)+"px";' />
</SPAN>
<SPAN id=Open_text style="DISPLAY: none">
语句未变,无法正常缩放图片,IE6、8下测试均报错,参数无效<br />
<img src="http://www.ali213.net/picfile/News/200909/ps_3.jpg" onload='javascript:if(this.width>200)this.style.width="200px";this.style.height=this.height*(200/this.width)+"px";' />
</SPAN></body>
</html>

解决方案 »

  1.   

    无报错<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>123</title>
    </head><body>
    <IMG id=Close_img onClick="this.style.display='none'; Close_text.style.display='none'; Open_img.style.display='inline'; Open_text.style.display='inline';"  alt="点击查看全文" src="http://bbs.dvbbs.net/skins/style_60/plus.gif" width=11 height=11 align=top><!--点击打开文章的图片-->
    <IMG id=Open_img style="DISPLAY: none" onClick="this.style.display='none'; Open_text.style.display='none'; Close_img.style.display='inline'; Close_text.style.display='inline';"  alt="点击关闭全文" src="http://bbs.dvbbs.net/Skins/Default/nofollow.gif" width=11 height=11 align=top>
    <SPAN id=Close_text >
    可以正常缩放图片<br />
    <img src="http://www.ali213.net/picfile/News/200909/ps_3.jpg" onload='javascript:if(this.width>200)this.style.width="200px";this.style.height=this.height*(200/this.width)+"px";' />
    </SPAN>
    </body>
    </html>
      

  2.   

    img的style.display为'none'时,不能检测高度的!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>123</title>
    </head><body>
    <IMG id=Close_img onClick="this.style.display='none'; Close_text.style.display='none'; Open_img.style.display='inline'; Open_text.style.display='inline';"  alt="点击查看全文" src="http://bbs.dvbbs.net/skins/style_60/plus.gif" width=11 height=11 align=top><!--点击打开文章的图片-->
    <IMG id=Open_img style="DISPLAY: none" onClick="this.style.display='none'; Open_text.style.display='none'; Close_img.style.display='inline'; Close_text.style.display='inline';"  alt="点击关闭全文" src="http://bbs.dvbbs.net/Skins/Default/nofollow.gif" width=11 height=11 align=top>
    <SPAN id=Close_text >
    可以正常缩放图片<br />
    <img src="http://www.ali213.net/picfile/News/200909/ps_3.jpg" onload='javascript:if(this.width>200)this.style.width="200px";this.style.height=this.height*(200/this.width)+"px";' />
    </SPAN>
    <SPAN id=Open_text style="">
    语句未变,无法正常缩放图片,IE6、8下测试均报错,参数无效<br />
    <img src="http://www.ali213.net/picfile/News/200909/ps_3.jpg" onload='javascript:if(this.width>200)this.style.width="200px";this.style.height=this.height*(200/this.width)+"px";' />
    </SPAN></body>
    </html>
      

  3.   

    51js问到blueidea再找到这,就你给出了原因,厉害,谢谢
    但是你现在这样改了,第一次出现页面的时候图片就出来了,虽然点击打开文章,再点击关闭可以使图片消失,但是总是很其怪的感觉,有没有更好的办法,能和我的原效果一模一样,又能使图片满足缩放的要求呢,新人没分,只能说多谢了,请再帮帮忙
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><body>
    <IMG id=Close_img onClick="this.style.display='none'; Close_text.style.display='none'; Open_img.style.display='inline'; Open_text.style.display='inline';"  alt="点击查看全文" src="http://bbs.dvbbs.net/skins/style_60/plus.gif" width=11 height=11 align=top><!--点击打开文章的图片-->
    <IMG id=Open_img style="DISPLAY: none" onClick="this.style.display='none'; Open_text.style.display='none'; Close_img.style.display='inline'; Close_text.style.display='inline';"  alt="点击关闭全文" src="http://bbs.dvbbs.net/Skins/Default/nofollow.gif" width=11 height=11 align=top>
    <SPAN id=Close_text >
    可以正常缩放图片<br />
    <img src="http://www.ali213.net/picfile/News/200909/ps_3.jpg" onload='javascript:if(this.width>200)this.style.width="200px";this.style.height=this.height*(200/this.width)+"px";' />
    </SPAN>
    <SPAN id=Open_text style="display:none">
    语句未变,无法正常缩放图片,IE6、8下测试均报错,参数无效<br />
    <img src="http://www.ali213.net/picfile/News/200909/ps_3.jpg" onload='javascript:if(this.width&&this.width>200){this.style.width="200px";this.style.height=this.height*(200/this.width)+"px";}' />
    </SPAN></body>
    </html>