mCustomScrollbar 有一个奇怪的问题 - 这里有类似的问题:
直到您重新调整窗口大小或按 F12(在 IE9 和 FF 上测试 - 因此是 Developer 和 Firebug),滚动条才会显示。只要您这样做,代码就会启动。元素最初是隐藏的,并使用 .show() 或 .fadeIn() 显示
CSS:
.info-text {
width: 230px;
height: 170px;
overflow: hidden;
display: block;
}
HTML:
<p class = "info-text">
Lorem...
</p>
JS:
$(".info-text").mCustomScrollbar();
JS 是在一个$(window).load(function(){...