首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >simplebar v1.1.9不使用带引导选项卡的firefox

simplebar v1.1.9不使用带引导选项卡的firefox
EN

Stack Overflow用户
提问于 2017-05-09 03:17:03
回答 1查看 1.4K关注 0票数 0

我使用滚动插件simplebar.js。它在所有浏览器中都很好,但我在Firefox中有问题。当我试图与bootstap选项卡结合时,simplebar无法在Firefox的新选项卡中呈现宽度。我使用的是simplebar v1.1.9。请有任何建议或替代方式来了解这一工作。

代码语言:javascript
复制
.box {
  height: 200px;
  overflow: hidden;
}
代码语言:javascript
复制
<link rel="stylesheet" href="https://rawgit.com/Grsmto/simplebar/v1.1.9/dist/simplebar.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<div class="container">
  <ul class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#home">Home</a></li>
    <li><a data-toggle="tab" href="#menu1">Menu 1</a></li>
    <li><a data-toggle="tab" href="#menu2">Menu 2</a></li>
  </ul>

  <div class="tab-content">
    <div id="home" class="tab-pane fade in active">
      <h3>HOME</h3>
      <p>Some content.</p>
    </div>
    <div id="menu2" class="tab-pane fade">
      <div class="box" data-simplebar-direction="vertical">
        <h3>Menu 2</h3>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
        <p>Some content in menu 2.</p>
      </div>
    </div>
    <div id="menu1" class="tab-pane fade">
      <div class="box" data-simplebar-direction="vertical">
        <h3>Menu 1</h3>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
        <p>Some content in menu 1.</p>
      </div>
    </div>
  </div>
</div>





<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://rawgit.com/Grsmto/simplebar/v1.1.9/dist/simplebar.min.js"></script>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-09 06:30:45

您必须在引导事件上调用shown.bs.tab重新计算。

代码语言:javascript
复制
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
    $('.box').simplebar('recalculate');
});

查看火狐中的fiddle

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43860478

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档