ZeroSherd
小狐狸
小狐狸
  • UID57164
  • 注册日期2019-06-20
  • 最后登录2019-11-03
  • 发帖数2
  • 经验4枚
  • 威望0点
  • 贡献值6点
  • 好评度0点
阅读:1004回复:3

请问如何隐藏或修改滚动条

楼主#
更多 发布于:2019-11-01 14:46
和UI格格不入,人家Chrome有新版的滚动条,我喜欢火狐希望我们也能不屈居人后。
 It's not compatible with UI. Chrome has alredy plugin a new version of scroll bar. I like Firefox. I hope we don't fall behind.
xx
xx
小狐狸
小狐狸
  • UID46274
  • 注册日期2014-06-08
  • 最后登录2022-12-07
  • 发帖数38
  • 经验48枚
  • 威望0点
  • 贡献值32点
  • 好评度8点
  • 社区居民
  • 忠实会员
1楼#
发布于:2019-11-02 00:49
userContent.css中加入这一条
* { scrollbar-width: none !important; }

或是用扩展
https://addons.mozilla.org/firefox/addon/hide-scrollbars/


我也不爱滚动条,之前用UC隐藏,但UC在某个nightly挂了。不想再折腾
ZeroSherd
小狐狸
小狐狸
  • UID57164
  • 注册日期2019-06-20
  • 最后登录2019-11-03
  • 发帖数2
  • 经验4枚
  • 威望0点
  • 贡献值6点
  • 好评度0点
2楼#
发布于:2019-11-03 23:13
xx:userContent.css中加入这一条* { scrollbar-width: none !important; }
或是用扩展
https://addons.mozilla.org/firefox/addon/hide-scrol...
回到原帖
谢谢
jaleo
火狐狸
火狐狸
  • UID2330
  • 注册日期2005-01-19
  • 最后登录2022-05-28
  • 发帖数239
  • 经验176枚
  • 威望0点
  • 贡献值158点
  • 好评度1点
  • 社区居民
  • 忠实会员
3楼#
发布于:2019-11-04 09:53
隐藏了不方便

我用的是悬浮的 49/53行修改颜色和透明度

// ==UserScript==
// @name           FloatingScrollbar.uc.js
// @namespace      nightson1988@gmail.com
// @include        main
// @version        0.0.3
// @note           Thanks to Griever(https://github.com/Griever/userChromeJS/blob/master/SmartScrollbar.uc.js) and Paul Rouget(https://gist.github.com/4003205)
// @note...........0.0.3 Fixed a problem of breaking hbox layout 
// @note           0.0.2 Remove usage of E4X (https://bugzilla.mozilla.org/show_bug.cgi?id=788293)
// ==/UserScript==
 
(function () {
    var prefs = Services.prefs,
        enabled;
    if (prefs.prefHasUserValue('userChromeJS.floating_scrollbar.enabled')) {
        enabled = prefs.getBoolPref('userChromeJS.floating_scrollbar.enabled')
    } else {
        prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
        enabled = true;
    }
 
    var css = '\
    @namespace url(http: //www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);\
    :not(select):not(hbox) > scrollbar {\
        -moz-appearance: none!important;\
        position: relative;\
        background-color: transparent;\
        background-image: none;\
        z-index: 2147483647;\
        padding: 0px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "vertical"] {\
        -moz-margin-start: -11px;\
        min-width: 11px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "vertical"] thumb {\
        min-height: 50px;\
    }\
   :not(select):not(hbox) > scrollbar[orient = "horizontal"] {\
        margin-top: -11px;\
        min-height: 11px;\
    }\
    :not(select):not(hbox) > scrollbar[orient = "horizontal"] thumb {\
        min-width: 50px;\
    }\
    :not(select):not(hbox) > scrollbar thumb {\
        -moz-appearance: none!important;\
        border-width: 0px!important;\
        border-radius: 3px!important;\
        background-color: rgba(255, 192, 0, 0.1)!important;\
    }\
    :not(select):not(hbox) > scrollbar thumb:active,\
    :not(select):not(hbox) > scrollbar thumb:hover {\
        background-color: rgba(255, 192, 0, 0.8)!important;\
    }\
    :not(select):not(hbox) > scrollbar scrollbarbutton, :not(select):not(hbox) > scrollbar gripper {\
        display: none;\
    }';
 
    var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
    var uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
 
    var p = document.getElementById('devToolsSeparator');
    var m = document.createElement('menuitem');
    m.setAttribute('label', "Schwebende Scrollbar");
    m.setAttribute('type', 'checkbox');
    m.setAttribute('autocheck', 'false');
    m.setAttribute('checked', enabled);
    p.parentNode.insertBefore(m, p);
    m.addEventListener('command', command, false);
 
    if (enabled) {
        sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
    }
 
    function command() {
        if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) {
            prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', false);
            sss.unregisterSheet(uri, sss.AGENT_SHEET);
            m.setAttribute('checked', false);
        } else {
            prefs.setBoolPref('userChromeJS.floating_scrollbar.enabled', true);
            sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
            m.setAttribute('checked', true);
        }
 
        let root = document.documentElement;
        let display = root.style.display;
        root.style.display = 'none';
        window.getComputedStyle(root).display; // Flush
        root.style.display = display;
    }
 
})();
游客

返回顶部