是这样的,我这个代码放到UBB中,把<img>换成[IMG]的时候我以前用下面这个
如果我还是用以前的onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333;\"
但只是有时候能控制大小!后来从这个看到用这个方法:
onload="this.width=this.offsetWidth>100?100:this.offsetWidth;"
我用了以后发现,有时候图片刷不出来,我引用的是别处的图片,比如:
<a href="http://bbs.zol.com.cn/new/s_photo/297/book_462297.img" target="_blank"><IMG onmousewheel="return bbimg(this)" SRC="http://bbs.zol.com.cn/new/s_photo/297/book_462297.img" border=0 alt=按此在新窗口浏览图片 onload="this.width=this.offsetWidth>500?500:this.offsetWidth;"></a>

解决方案 »

  1.   

    因为你要把html转为ubbonload="this.width=this.offsetWidth>100?100:this.offsetWidth;"
    这里有一个>
    所以出了问题
      

  2.   

    <a href="http://bbs.zol.com.cn/new/s_photo/297/book_462297.img" target="_blank"><IMG onmousewheel="return bbimg(this)" SRC="http://bbs.zol.com.cn/new/s_photo/297/book_462297.img" border=0 alt=按此在新窗口浏览图片 onload="this.width=this.offsetWidth>500?500:this.offsetWidth;"></a>上面是我UBB过滤后的输出结果,应该不是>的问题吧??我把页面保存下来后,竟然能看到图片????这是为什么啊?