【问题标题】:Custom overflow scroll bar module自定义溢出滚动条模块
【发布时间】:2012-07-30 05:06:52
【问题描述】:

我有一个 Drupal 站点,其中的 div 隐藏了溢出。我希望内容可以横向滚动,但不希望使用那个难看的浅色滚动条。我的网站主要是黑暗的,所以我想要一些黑暗且不太引人注目的东西。

我已经搜索了几个小时,但似乎没有一个普通的 jquery 插件可以工作。我试过安装我找到的任何一个,但它们都以相同的方式结束。根本没有滚动条。那么有人知道 drupal 的模块或插件为什么不起作用吗?

【问题讨论】:

    标签: jquery drupal drupal-7 scroll overflow


    【解决方案1】:

    我使用 jScrollPane 没有任何大惊小怪,最好的是它可以工作

    jscrollpane.kelvinluck.com

    您还可以自定义主题。

    【讨论】:

    • 我只尝试了基本的 jscrollpane,没有进行任何自定义,也没有显示任何滚动条。
    • 尝试使用 nicescroll 窗格,它非常容易访问。 $('html').niceScroll({cursorborder:"",cursorcolor:"#333333",cursorwidth:"8px", boxzoom:true, autohidemode:false}); preservenativescrolling: false, cursorwidth: '8px', cursorborder: 'none', cursorborderradius:'0px', cursorcolor:"#39CCDB", autohidemode: false, background:"#999999" })
    【解决方案2】:

    您可以尝试为您的网站添加jQuery Custom Scrollbar 插件。

    SEE DEMO 在行动中。

    用法:

    <head> 中包含关注:

    <link href="path-to-latest/custom-scrollbar-plugin/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
    
    <script src="path-to-latest/jquery/1.7/jquery.min.js"></script>
    <script src="path-to-latest/jqueryui/1.8/jquery-ui.min.js"></script>
    
    <script src="path-to-latest/custom-scrollbar-plugin/jquery.mousewheel.min.js"></script>
    <script src="path-to-latest/custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
    
    <script>
        (function($){
            $(window).load(function(){
                $("#content_1").mCustomScrollbar({
                    scrollButtons:{
                        enable:true
                    }
                });
            });
        })(jQuery);
    </script>
    

    您的内容应位于以下&lt;div&gt;

    <div id="content_1" class="content">
        /* Your content */
    </div>
    

    SEE EXAMPLE FIDDLE

    【讨论】:

    • 我尝试完全按照我的指示去做,但没有出现任何栏或任何东西。
    • 我没有代码了。不是为了那个。我最近尝试的是 jScrollPane。
    • jQuery Custom Scrollbar 插件是如何工作的?看这个演示:jsfiddle.net/akhurshid/nwfpy
    • 那个 jsfiddle 没有适合我的滚动条
    猜你喜欢
    • 2012-10-20
    • 1970-01-01
    • 2015-05-16
    • 2011-11-13
    相关资源
    最近更新 更多