<!DOCTYPE html>
<html lang="zn-ch">
<head>
<meta charset="utf-8">
<title>下拉菜单和滚动监听</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>
<body style="margin:100px;">
<!-- 滚动监听 -->
<nav class="navbar navbar-default" id="nav">
<a href="" class="navbar-brand">Web开发</a>
<ul class="nav navbar-nav">
<li><a href="#html5">HTML5</a></li>
<li><a href="#bootstrap">Bootstrap</a></li>
<li class="dropdown"><a href="" data-toggle="dropdown">Javascript<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#jquery">Jquery</a></li>
<li><a href="#yui">Yui</a></li>
<li><a href="#extjs">Extjs</a></li>
</ul>
</li>
</ul>
</nav>
<div data-offset="0" data-spy="scroll" data-target="#nav" style="padding:0px 10px;height:200px;overflow:auto;position:relative;">
<h4 id="html5">HTML5</h4>
<p>这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5这是HTML5</p>
<h4 id="bootstrap">Bootstrap</h4>
<p>这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap这是Bootstrap</p>
<h4 id="jquery">Jquery</h4>
<p>这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery这是Jquery</p>
<h4 id="yui">yui</h4>
<p>这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui这是yui</p>
<h4 id="extjs">extjs</h4>
<p>这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs这是extjs</p>
</div>
</body>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
</html>
效果如下:
