<title>Bootstrap Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//libs.baidu.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
<script src="//libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="//libs.baidu.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
#section1 {color: #fff; background-color: #1E88E5;}
#section2 {color: #fff; background-color: #673ab7;}
#section3 {color: #fff; background-color: #ff9800;}
#section41 {color: #fff; background-color: #00bcd4;}
#section42 {color: #fff; background-color: #009688;}
@media screen and (max-width: 810px) {
#section1, #section2, #section3, #section41, #section42 {
<body data-spy="scroll" data-target="#myScrollspy" data-offset="20">
<nav class="col-sm-3" id="myScrollspy">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#section1">Section 1</a></li>
<li><a href="#section2">Section 2</a></li>
<li><a href="#section3">Section 3</a></li>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Section 4 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#section41">Section 4-1</a></li>
<li><a href="#section42">Section 4-2</a></li>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>
<p>Try to scroll this section and look at the navigation list while scrolling!</p>