赞助广告 赞助广告
  当前位置:网络学院ASP技术ASP技巧 → 恢复SP1的图片随鼠标滚轮缩放功能
恢复SP1的图片随鼠标滚轮缩放功能
日期:2005年11月19日 作者: 人气: 查看:[大字体 中字体 小字体]

用记事本打开inc/Dv_ubbcode.asp,找到

Private Function bbimg(strText,ssize)
  Dim s
  s=strText
  re.Pattern="<img(.[^>]*)>"
  If ssize=500 Then
   s=re.replace(s,"<img$1 onload=""javascript:if(this.width>"& ssize &")this.style.width="&ssize&";"">")
  Else
   s=re.replace(s,"<img$1 onload=""javascript:if(this.width>"& ssize &")this.style.width="&ssize&";if(this.height>250)this.style.width=(this.width*250)/this.height;"">")
  End If
  bbimg=s
End Function

修改为

Private Function bbimg(strText,ssize)
  Dim s
  s=strText
  re.Pattern="<img(.[^>]*)>"
  If ssize=500 Then
   s=re.replace(s,"<img$1 onmousewheel=""return bbimg(this)""  onload=""javascript:if(this.width>"& ssize &")this.style.width="&ssize&";"">")
  Else
   s=re.replace(s,"<img$1 onmousewheel=""return bbimg(this)""  onload=""javascript:if(this.width>"& ssize &")this.style.width="&ssize&";if(this.height>250)this.style.width=(this.width*250)/this.height;"">")
  End If
  bbimg=s
End Function

用记事本打开Main.js,找到

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) {
if(event.ctrlKey) {
  var zoom = parseInt(o.style.zoom, 10) || 100;
  zoom -= event.wheelDelta / 12;
  if(zoom > 0) {
   o.style.zoom = zoom + '%';
  }
  return false;
} else {
  return true;
}
}

注意:此方法与动网原来的缩放略有不同,要求鼠标移动到图片上按住Ctrl键滚动鼠标滚轮图片才缩放,不按住Ctrl则为整个页面滚动,图片不缩放!

(出处:CodeFans转载)

相关文章:
 
·图片加密能手Private Pictures
·GIF Runner--动态图片搜搜搜
·Word2000的图片使用技巧两则
·Windows XP新版本图片赏析
·图片加密能手Private Pictures
·能干的图片小管家PhotoFamily
·控制Word的浮动图片
·图片收藏器--图片收藏好帮手
·图片格式转化能手Transformer
·图片艺术字符化软件大放送
相关软件:
 
·逸乐吧-图片欣赏程序 v1.0
·林子图片管理系统数据库存储版 v1.0
·不停旋转的图片导航程序
·实用-背景图片自动切换效果
·推荐-改变网页背景图片
·ASP ListPics(ASP图片列表) v4.0 多语言版
·Wrance图片系统目录直读版 v1.0
·31张论坛用心情图片集(附演示)
·65张论坛用心情图片集(附演示)
·十五套论坛用漂亮等级图片
  特别推荐
  热点TOP10