【问题标题】:how to fix content div height with jquery tocify or bootstrap toc如何使用 jquery tocify 或 bootstrap toc 修复内容 div 高度
【发布时间】:2017-06-05 01:56:30
【问题描述】:

任何人都可以建议使用 jquery tocify 插件或引导 toc 类是否可以修复 div 高度。 在这两种情况下,我都可以在我的代码中应用 toc(目录)。 但是当我点击左平面时,整个页面开始滚动。 我只希望内容具有固定高度滚动而不是页眉和页脚。

<body>
    <div id=header>
        this is header
    </div>
    <div class="row">
        <div id="span3">
            <div id="nav">
            </div>
        </div>
        <div id="span9">
            <h1>heading1</h1>
            <p>some content</p>
            <h1>heading2</h1>
            <p>some content</p>
            <h1>heading3</h1>
            <p>some content</p>
        </div>
    </div>
    <script>
            $('#nav').tocify();
    </script>
</body>

head 标签中包含其他 jquery 和 bootstrap。

现在,当我单击快捷方式时,整个页面滚动。 我不想标题滚动。 同样在固定 div 的高度之后。 我也会插入页脚。 感谢您的任何建议。

【问题讨论】:

  • 您不能将页眉和页脚设置为位置:固定;吗?不要以为我完全明白你想要什么。
  • 我想修复
    的高度。这样我的目录就可以在这个 div 中工作。这样在这个 div 之后我可以添加 commet 部分。然后是页脚。

标签: jquery html css twitter-bootstrap jquery-tocify-js


【解决方案1】:

您的页脚和页眉应该有 position: fixed 定义。或者你可以使用一些 bootstrap .fixed-top 类。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-21
    • 2011-10-14
    • 2012-10-09
    • 2016-04-01
    • 1970-01-01
    • 2020-02-24
    • 2020-03-06
    • 1970-01-01
    相关资源
    最近更新 更多