jquery - mCustomScrollbar - 滚动条只出现在 F12 按下时(开发工具/Firebug)而不是隐藏元素/div

标签 jquery css scrollbar custom-component mcustomscrollbar

mCustomScrollbar 有一个奇怪的问题 - 类似的问题在这里:

stubborn prolem with popular custom scrollbar

在您调整窗口大小或按下 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(){...

最佳答案

您可以在初始时尝试使用该属性

advanced:{  
    updateOnContentResize:true,   
    updateOnBrowserResize:true
  } 

所以你应该有类似的东西:

$(".info-text").mCustomScrollbar({
   advanced:{  
    updateOnContentResize:true,   
    updateOnBrowserResize:true   

  } 
});

关于jquery - mCustomScrollbar - 滚动条只出现在 F12 按下时(开发工具/Firebug)而不是隐藏元素/div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16688504/

相关文章:

jquery - 如果有新请求进来,如何取消进行中的请求?

javascript - 无法在谷歌地图中保存多边形

html - CSS 伪类,目标是 DIV 中的第一个 DIV .class

javascript - 显示覆盖 DIV 时不需要的浏览器滚动条更改

javascript - 为什么将内容插入选项卡后连接线会消失?

html - 为什么 YSlow 在 Head 部分声明了 Css 仍然在 body 部分?

jquery - 为什么 outerWidth() 在页面加载时不能正常工作?

html - 如何使导航菜单的原始网站背景固定且100%宽?

css - 在 css 中使用具有高度自动的溢出-y

jquery - Textarea 没有在 jQuery 中获取更新的文本