当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp实现图片右键滑轮控制大小的函数

ASP
TSYS 新闻列表JS调用下载
使用asp代码突破图片的防盗连
一种理论上最快的Web数据库分页方法
asp:debug类调试程序
如何增加Referer功能--反向链接插件
pjblog中清空引用的小程序
光碟工具 Alcohol 120% v1.9.6.4719 下载(附序列号注册码)
ASP实现头像图像随机变换
UTF-8 Unicode Ansi 汉字GB2321几种编码转换程序
[转]XMLHTTPRequest的属性和方法简介
ASP常用函数:getpy()
我用ASP写的m行n列的函数,动态输出创建TABLE行列
ASP常用函数:Delay()
ASP常用函数:Trace()
[转]ASP实现关键词获取(各搜索引擎,GB2312及UTF-8)
对象标记具有无效的 ''MSWC.MyInfo'' ProgID
ServerVariables集合检索预定的环境变量
HTTP_HOST 和 SERVER_NAME 的区别详解
[转]ASP常用函数:TimeZone
Eval 函数 | Execute 语句 | ExecuteGlobal 语句

ASP 中的 asp实现图片右键滑轮控制大小的函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 101 ::
收藏到网摘: n/a

<%
'******************************
'函数:bbimg(l1,maximgheight,maximgwidth)
'参数:l1,图片路径;maximgheight,最大允许图片高度;maximgwidth,最大允许图片宽度
'作者:阿里西西
'日期:2007/7/12
'描述:限制页面图片的最大高度和宽度
'示例:<%=bbimg("/upload/tech/20091012/20091012012317_7a614fd06c325499f1680b9896beedeb.gif",300,100)%>
'******************************
function bbimg(l1,maximgheight,maximgwidth)
dim l2,I2:l2=l1
set I2=new regexp
I2.global=true
I2.ignorecase=true
I2.pattern="<img.[^>]*(src="".[^>]+?"").[^>]*>"
l2=I2.replace(l2,"<img $1 onload=""javascript:if(this.width>"&maximgwidth&")this.style.width="&maximgwidth&"; if(this.height>"&maximgheight&")this.style.width=(this.width*"&maximgheight&")/this.height;"" />")
bbimg=l2
set I2=nothing
end function

%>