zoukankan      html  css  js  c++  java
  • Bootstrap_Javascript_滚动监视器

      滚动监控器是Bootstrap提供的非常实用的JavaScript插件,被广泛应用到Web开发中。其表现形式是:

      1、当用户鼠标滚动时,滚动条的位置会自动更新导航条中相应的导航项。

      2、用户拖动滚动条,当滚动到@mdo时,上面的@mdo导航项就会高亮显示.

    <div class="bs-docs-section">
      <div class="bs-example">
        <nav role="navigation" class="navbar navbar-default navbar-static" id="navbar-example2">
          <div class="container-fluid">
            <div class="navbar-header">
              <button data-target=".bs-example-js-navbar-scrollspy" data-toggle="collapse" type="button" class="navbar-toggle collapsed">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a href="#" class="navbar-brand">Project Name</a>
            </div>
            <div class="collapse navbar-collapse bs-example-js-navbar-scrollspy">
              <ul class="nav navbar-nav">
                <li><a href="#fat">@fat</a></li>
                <li><a href="#mdo">@mdo</a></li>
              </ul>
            </div>
          </div>
        </nav>
        <div class="scrollspy-example" data-offset="0" data-target="#navbar-example2" data-spy="scroll">
          <h4 id="fat">@fat</h4>
          <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
          <h4 id="mdo">@mdo</h4>
          <p>Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.</p>
        </div>
      </div><!-- /example -->
  • 相关阅读:
    0100相同的树 Marathon
    0017电话号码的字母组合 Marathon
    0236二叉树的最近公共祖先 Marathon
    1365有多少小于当前数字的数字 Marathon
    0701二叉搜索树的插入操作 Marathon
    0538二叉搜索树转为累加树 Marathon
    0039组合总和 Marathon
    0098验证二叉搜索树 Marathon
    0700二叉搜索树中的搜索 Marathon
    0108有序数组转为二叉搜索树 Marathon
  • 原文地址:https://www.cnblogs.com/Ryan344453696/p/5014815.html
Copyright © 2011-2022 走看看