gpt4 book ai didi

javascript - malihu 自定义滚动条将
放在 Electron 上的错误位置

转载 作者:行者123 更新时间:2023-12-03 12:20:30 30 4
gpt4 key购买 nike

malihu自定义滚动条放置<div class='mCSB_draggerRail'></div>在 Electron 上的错误位置。我查看了浏览器中的版本,它工作得很好。它生成的 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>

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

这是它在 Electron 本身中产生的:

<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任何时候我运行它都会出错。我不知道发生了什么,请帮忙。

附言如果需要解开这个谜团,我会附上它。

最佳答案

我解决了这个问题。

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

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

关于javascript - malihu 自定义滚动条将 <div class ='mCSB_draggerRail' ></div> 放在 Electron 上的错误位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61354379/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com