Bootstrap scroll listener (Scrollspy) plugin

<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap instance - Scrollspy plugin</title>
   <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
   <script src="/scripts/jquery.min.js"></script>
   <script src="/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>

<nav id="navbar-example" class="navbar navbar-default navbar-static" role="navigation">
   <div class="navbar-header">
      <button class="navbar-toggle" type="button" data-toggle="collapse"
         data-target=".bs-js-navbar-scrollspy">
         <span class="sr-only">Toggle navigation</span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">教程名称</a>
   </div>
   <div class="collapse navbar-collapse bs-js-navbar-scrollspy">
      <ul class="nav navbar-nav">
         <li><a href="#ios">iOS</a></li>
         <li><a href="#svn">SVN</a></li>
         <li class="dropdown">
            <a href="#" id="navbarDrop1" class="dropdown-toggle"
               data-toggle="dropdown">Java
               <b class="caret"></b>
            </a>
            <ul class="dropdown-menu" role="menu"
               aria-labelledby="navbarDrop1">
               <li><a href="#jmeter" tabindex="-1">jmeter</a></li>
               <li><a href="#ejb" tabindex="-1">ejb</a></li>
               <li class="divider"></li>
               <li><a href="#spring" tabindex="-1">spring</a></li>
            </ul>
         </li>
      </ul>
   </div>
</nav>
<div data-spy="scroll" data-target="#navbar-example" data-offset="0"
   style="height:200px;overflow:auto; position: relative;">
   <h4 id="ios">iOS</h4>
   <p>iOS is a mobile operating system developed and published by Apple Inc. Originally released in 2007 for the iPhone, iPod Touch and Apple
      TV. iOS is derived from OS X, and they share the Darwin foundation. The OS X operating system is used on Apple computers, and iOS is Apple's mobile version.
   </p>
   <h4 id="svn">SVN</h4>
   <p>Apache Subversion, often abbreviated as SVN, is an open source version control system software. Subversion was created in 2000 by CollabNet Corporation. But now it has grown into a project of the Apache Software Foundation, so it has a rich community of developers and users.
   </p>
   <h4 id="jmeter">jMeter</h4>
   <p>jMeter is an open source testing software. It is a 100% pure Java application for load and performance testing.
   </p>
   <h4 id="ejb">EJB</h4>
   <p>Enterprise Java Beans (EJB) is a development framework for creating highly scalable and robust enterprise-level applications, deployed on J2EE compatible application servers such as JBOSS, Web Logic, etc.
   </p>
   <h4 id="spring">Spring</h4>
   <p>The Spring Framework is an open source Java platform that provides complete infrastructure support for the rapid development of powerful Java applications.
   </p>
   <p>The Spring Framework was originally written by Rod Johnson and first released in June 2003 under the Apache 2.0 license.
   </p>
</div>

</body>
</html>

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326771200&siteId=291194637