返回论坛首页联系我们论坛帮助
>> 网页设计交流,相互学习,共同进步……
搜一搜相关精彩主题 
泥客论坛(十几年前的回忆)泥客技术☆网页制作☆ → 限制签名图片的大小

您是本帖的第 6132 个阅读者
树形 打印
标题:
限制签名图片的大小
小轲
帅哥哟,离线,有人找我吗?
头衔:泥客主席
等级:校长
威望:10
文章:10703
积分:67062
注册:1949年10月1日
楼主
  QQ 点击这里发送电子邮件给小轲 访问小轲的主页

发贴心情
限制签名图片的大小

修改inc\main.js文件,在第201行左右,找到

function bbimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;
}

改为

function bbimg(o){
// var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
// return false;}

或者修改:把inc\Dv_ubbcode.asp 中的这个部分(大概在291行)

If ssize=500 Then
   s=re.replace(s,"<img$1 onmousewheel=""return bbimg(this)"" onload=""javascript:if(this.width>screen.width-"&ssize&")this.style.width=screen.width-"&ssize&";"">")
  Else
   s=re.replace(s,"<img$1 onmousewheel=""return bbimg(this)"" onload=""javascript:if(this.width>screen.width-"&ssize&")this.style.width=screen.width-"&ssize&";if(this.height>250)this.style.width=(this.width*250)/this.height;"">")

If ssize=500 Then
   s=re.replace(s,"<img$1onmousewheel=""return bbimg(this)"" onload=""javascript:if(this.width>screen.width-"&ssize&")this.width=screen.width-"&ssize&";"">")
  Else
   s=re.replace(s,"<img$1onload=""javascript:if(this.width>screen.width-"&ssize&")this.width=screen.width-"&ssize&";if(this.height>100)this.height=100;"">")
  End If

1、修改if(this.height>100)this.height=100;  为:if(this.height>100)this.style.height=100;  这样做可以保证大部分图片按比例缩放,只有少数特殊的图片会被变形。

2、修改if(this.height>100)this.height=100; 为:if (this.height>100){var rate=100 / this.height;this.style.width=this.width * rate;}


ip地址已设置保密
2004/12/2 22:49:29

 1   1   1/1页      1    
Powered By Dvbbs Version 7.1.0 Sp1
页面执行时间 00.17188 秒, 4 次数据查询