恋雾迷尘论坛's Archiver

爱雨冷雪 发表于 2006-1-16 11:51

滾軸放大的圖像 (只用滾軸)

其實 Discuz 4 已經含 CTRL+Mouse Wheel 放大縮小圖像的功能, 但如果大家注意一下, 無論在 Internet Explorer 或 Firefox 都會出現一些問題, 其實很簡單, CTRL+Mouse Wheel 在 Internet Explorer 或 Firefox 都是其本身放大縮小文字的 shortcut, 為了解決此問題, 本站仍然使用原來從 2.0 使用至今的只用 mouse wheel 便可, 但對 firefox 來說仍然是失效的.

修改辦法很簡單, 只是修改 include/common.js

[code]function imgzoom(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;
        }
}
[/code]

更換為

[code]function imgzoom(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';return false;}
function Download(ForumNo,TopicNo,ReplyNo){
document.Download.forum.value=ForumNo;
document.Download.topic.value=TopicNo;
document.Download.reply.value=ReplyNo;
document.Download.submit();
}
[/code]

测试:

[img]http://www.23717.com/bbs/images/23717_ydqx/logo.jpg[/img]

Aben 发表于 2006-1-25 04:57

我的论坛好象就不行哦

雪帮我看看怎么回事啊?

[url]http://aben.meyu.net/bbs/viewthread.php?tid=125[/url]

YCJW2002 发表于 2006-2-12 20:04

*** 作者被禁止或删除 内容自动屏蔽 ***

爱雨冷雪 发表于 2006-2-13 03:01

晕,看不懂吗?

是改JS,没有什么少JS的.

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.