malihu 自定义滚动条将 <div class='mCSB_draggerRail'></div> 放在错误的电子位置

malihu custom scrollbar puts <div class='mCSB_draggerRail'></div> in wrong place on electron

malihu 自定义滚动条将 <div class='mCSB_draggerRail'></div> 放在电子上的错误位置。 我查看了浏览器中的版本,它工作得很好。 HTML 它生成的代码看起来像这样:

<div class="servers-container mCustomScrollbar _mCS_1" style="overflow: auto;" data-mcs-theme="light-thick">
        <div id="mCSB_1" class="mCustomScrollBox mCS-light-thick mCSB_vertical mCSB_inside" style="max-height: none;"
            tabindex="0">
            <div id="mCSB_1_container" class="mCSB_container" style="position: relative; top: 0px; left: 0px;"
                dir="ltr">
                <div class="servers">
                </div>
            </div>
            <div id="mCSB_1_scrollbar_vertical"
                class="mCSB_scrollTools mCSB_1_scrollbar mCS-light-thick mCSB_scrollTools_vertical"
                style="display: block;">
                <div class="mCSB_draggerContainer">
                    <div id="mCSB_1_dragger_vertical" class="mCSB_dragger"
                        style="position: absolute; min-height: 30px; top: 0px; display: block; height: 372px; max-height: 495px;">
                        <div class="mCSB_dragger_bar" style="line-height: 30px;"></div>
                    </div>
                    <div class="mCSB_draggerRail"></div>
                </div>
            </div>
        </div>
    </div>

但在电子本身中,它会在内部生成,从而导致古怪的行为...

这是它在电子本身中产生的:

<div class="servers-container mCustomScrollbar _mCS_1" style="overflow: auto;" data-mcs-theme="light-thick">
        <div id="mCSB_1" class="mCustomScrollBox mCS-light-thick mCSB_vertical mCSB_inside" style="max-height: none;"
            tabindex="0">
            <div id="mCSB_1_container" class="mCSB_container" style="position: relative; top: 0px; left: 0px;"
                dir="ltr">
                <div class="servers">

                </div>
            </div>
            <div id="mCSB_1_scrollbar_vertical"
                class="mCSB_scrollTools mCSB_1_scrollbar mCS-light-thick mCSB_scrollTools_vertical"
                style="display: block;">
                <div class="mCSB_draggerContainer">
                    <div id="mCSB_1_dragger_vertical" class="mCSB_dragger"
                        style="position: absolute; min-height: 30px; display: block; height: 77px; max-height: 316px; top: 0px;">
                        <div class="mCSB_dragger_bar" style="line-height: 30px;"></div>
                        <div class="mCSB_draggerRail"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

这是我用来实现这个滚动条的代码:

<script defer src="js/jquery.min.js"></script>
    <script defer src="js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script defer src="renderer.js"></script>
    <script>
        const $ = require('jquery');
        require("jquery-mousewheel")($);
        require("malihu-custom-scrollbar-plugin")($);

        (function($){
        $(window).load(function(){
            $(".horizontalScrollbar").mCustomScrollbar({
                    scrollButtons:{ enable:false },
                    horizontalScroll:true,
                    advanced:{autoExpandHorizontalScroll:true}
                });
            });
        });
    </script>

它也会在我 运行 任何时候给出 Uncaught ReferenceError: jQuery is not defined 错误。我不知道发生了什么请帮助。

P.S。如果需要解开这个谜团,我会附上。

我解决了这个问题。

Jinixx 上传了针对此问题的修复: malihu-custom-scrollbar-plugin 3.1.7

此问题是由新 jQuery 3.5.x 引起的,其中包含一些重大更改。 (source)