asp实现图像右键滑轮控制大小的函数
发布时间:2023-09-08 12:44:15 所属栏目:Asp教程 来源:
导读:asp实现图片右键滑轮控制大小的函数
<%
'******************************
'函数:bbimg(l1,maximgheight,maximgwidth)
'参数:l1,图片路径;maximgheight,最大允许图片高度;maximgwidth,最大允许图
<%
'******************************
'函数:bbimg(l1,maximgheight,maximgwidth)
'参数:l1,图片路径;maximgheight,最大允许图片高度;maximgwidth,最大允许图
asp实现图片右键滑轮控制大小的函数 <% '****************************** '函数:bbimg(l1,maximgheight,maximgwidth) '参数:l1,图片路径;maximgheight,最大允许图片高度;maximgwidth,最大允许图片宽度 '作者:阿里西西 '日期:2007/7/12 '描述:限制页面图片的最大高度和宽度 '示例:<%=bbimg("alixixi.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 %> (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐