我正在尝试通过设置 .mCSB_dragger
的宽度来增加滚动条的宽度,如 documentation 中所述.但滚动条宽度保持不变。
$('#container1').mCustomScrollbar({
theme:"dark-3"
});
$(document).on('click', '.participants li', function(e){
});
#container1 {
height:200px;
width:100px;
padding:5px;
border:1px solid black;
}
.mCSB_dragger{
width:25px;
}
<link rel="stylesheet" href="//malihu.github.io/custom-scrollbar/jquery.mCustomScrollbar.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//malihu.github.io/custom-scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
<div id="container1">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
<p>6</p>
<p>6</p>
</div>
代码如下:
最佳答案
试试这个,我认为它需要被覆盖,但覆盖不是一个好的做法。 希望对您有所帮助
.mCSB_dragger_bar{
width:13px!important;
}
如果您希望滚动旋钮也调整其宽度,您也可以覆盖
.mCSB_draggerRail{
width:13px!important;
}
关于javascript - 如何使用 CSS 设置 mCustomScrollbar 的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52642514/