落拓居论坛 » 电脑网络 » 网页技术 » 鼠标滚轮自由缩放论坛图片
本页主题: 鼠标滚轮自由缩放论坛图片 打印 | 加为IE收藏 | 收藏主题 | 上一主题 | 下一主题

落拓居士

头衔:骆驼 骆驼

级别: 管理员
精华: 28
发帖: 3944
威望: 3338 点
金钱: 69144 银两
贡献值: 27 点
好评度: 391 点
朋友圈: 落拓
在线时间:521(小时)
注册时间:2005-12-13
最后登录:2020-09-15

鼠标滚轮自由缩放论坛图片

本帖被 落拓居士 从 版主交流 移动到本区(2010-04-13)
修改template\wind\下的文件header.htm:

查找 <html xmlns="http://www.w3.org/1999/xhtml">

在下面添加:

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

修改require\下的文件bbscode.php:

找到代码:

function cvpic($url,$type='',$picwidth='',$picheight=''){
    global $db_bbsurl,$picpath,$attachpath,$code_num,$code_htm;
    $code_num++;

    $lower_url=strtolower($url);
    if(substr($lower_url,0,4)!='http' && !$type)$url=$db_bbsurl.$url;
    if(strpos($lower_url,'login')!==false && (strpos($lower_url,'action=quit')!==false || strpos($lower_url,'action-quit')!==false)){
        $url=preg_replace('/login/i','log in',$url);
    }
    if($picwidth || $picheight){
        $onload = "onload=\"";
        $picwidth  && $onload .= "if(this.width>'$picwidth')this.width='$picwidth';";
        $picheight && $onload .= "if(this.height>'$picheight')this.height='$picheight';";
        $onload .= "\"";
        $code="<img src=\"$url\" border=\"0\" onclick=\"if(this.width>=$picwidth) window.open('$url');\" $onload>";
    } else{
        $code="<img src=\"$url\" border=\"0\" onclick=\"if(this.width>screen.width-461) window.open('$url');\">";
    }
    $code_htm[-1][$code_num]=$code;

    if($type){
        return $code;
    } else{
        return "<\twind_code_$code_num\t>";
    }
}

用以下代码替换:

function cvpic($url,$type='',$picwidth='',$picheight=''){
global $db_bbsurl,$picpath,$attachpath,$code_num,$code_htm; {
$code_num++;
if(strtolower(substr($url,0,4)) != 'http' && !$type)$url=$db_bbsurl.$url; 
if($picwidth && $picheight){ 
$code = "<img src='$url' border=0 onmousewheel=\"return bbimg(this)\" onclick=\"if(this.width>=$picwidth) window.open('$url');\" onload=\"if(this.width > $picwidth)this.width = $picwidth;if(this.height > $picheight) this.height = $picheight;\">";} else{ 
$code = "<img src='$url' border=0 onmousewheel=\"return bbimg(this)\" onclick=\"if(this.width>screen.width-461) window.open('$url');\" onload=\"if(this.width>screen.width-460)this.width=screen.width-460;\">";
}

$code_htm[-1][$code_num]=$code;
if($type){
return $code;
} else{ 
return "<\twind_code_$code_num\t>";
}
}
男人就应该象个男人,说男人的话,做男人的事!
顶端 Posted: 2008-03-11 09:51 | [楼 主]
落拓居论坛 » 网页技术

Total 0.025921(s) query 5, Time now is:03-29 17:53, Gzip disabled 蜀ICP备11007877号-1
Powered by PHPWind v5.3 Certificate Code © 2003-07 PHPWind.com Corporation