"ScrollSpy"
Bootstrap 3.3.0 Snippet by megatela

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <body id="home" data-spy="scroll" data-target="#navigation" data-offset="20"> <div class="container"> <div class="row"> <nav class="col-sm-3" id="navigation"> <div class="main-menu" id="navigation"> <ul class="nav nav-pills nav-stacked"> <li class="active"><a href="#inicio">Home</a></li> <li><a href="#servicios">Services</a></li> <li><a href="#eventos">Events</a></li> <li><a href="#menu">Menu</a></li> <li><a href="#book">Book</a></li> </ul> </div> </nav> <div class="col-sm-9"> <h1><a href="http://getbootstrap.com/javascript/#scrollspy">ScrollSpy</a></h1> <div id="inicio"> <h3>Home</h3> <p>Try to scroll this section and look at the navigation list while scrolling!</p> </div> <div id="servicios"> <h3>Services</h3> <p>Try to scroll this section and look at the navigation list while scrolling!</p> </div> <div id="eventos"> <h3>Events</h3> <p>Try to scroll this section and look at the navigation list while scrolling!</p> </div> <div id="menu"> <h3>Menu</h3> <p>Try to scroll this section and look at the navigation list while scrolling!</p> </div> <div id="book"> <h3>Book</h3> <p>Try to scroll this section and look at the navigation list while scrolling!</p> </div> </div> </div> </div>
body { position: relative; } .nav-pills { top: 20px; position: fixed; } .col-sm-9 div { height: 200px; font-size: 14px; } #inicio {color: #fff; background-color: #1E88E5;} #servicios {color: #fff; background-color: #673ab7;} #eventos {color: #fff; background-color: #ff9800;} #menu {color: #fff; background-color: #00bcd4;} #book {color: #fff; background-color: #009688;}

Related: See More


Questions / Comments: