Bootstrap Scrollspy
home
Run
screen_rotation
fullscreen
cloud_download
<html> <head> <title>Bootstrap Scrollspy</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> <style> #sectionOne {color: #fff; background-color: #FFA500;} #sectionTwo {color: #fff; background-color: #008000;} #sectionThree{color: #fff; background-color: #00FF00} #sectionFour {color: #fff; background-color: #00FFFF} @media screen and (max-width: 300px) { #sectionOne, #sectionTwo, #sectionThree, #sectionFour{ margin-left: 10px; } } </style> </head> <body> <div class="container" style="padding:10px;"> <nav class="col-sm-3" id="myScrollspy"> <ul class="nav nav-pills nav-stacked"> <li><a href="#sectionOne">Section One</a></li> <li><a href="#sectionTwo">Section Two</a></li> <li><a href="#sectionThree">Section Three</a></li> <li><a href="#sectionFour">Section Four</a></li> </ul> </nav> <div data-spy="scroll" data-target="myNavbar" data-offset="12"> <div id="sectionOne"> <div class="container"> <h1>Section One</h1> <p> Demo Section</p> </div> </div> <div id="sectionTwo"> <div class="container"> <h1>Section Two</h1> <p> Demo Section</p> </div> </div> <div id="sectionThree"> <div class="container"> <h1>Section Three</h1> <p> Demo Section</p> </div> </div> <div id="sectionFour"> <div class="container"> <h1>Section Four</h1> <p> Demo Section</p> </div> </div> </div> </body> </html>
<html> <head> <title>Bootstrap Scrollspy</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> <style> #sectionOne {color: #fff; background-color: #FFA500;} #sectionTwo {color: #fff; background-color: #008000;} #sectionThree{color: #fff; background-color: #00FF00} #sectionFour {color: #fff; background-color: #00FFFF} @media screen and (max-width: 300px) { #sectionOne, #sectionTwo, #sectionThree, #sectionFour{ margin-left: 10px; } } </style> </head> <body> <div class="container" style="padding:10px;"> <nav class="col-sm-3" id="myScrollspy"> <ul class="nav nav-pills nav-stacked"> <li><a href="#sectionOne">Section One</a></li> <li><a href="#sectionTwo">Section Two</a></li> <li><a href="#sectionThree">Section Three</a></li> <li><a href="#sectionFour">Section Four</a></li> </ul> </nav> <div data-spy="scroll" data-target="myNavbar" data-offset="12"> <div id="sectionOne"> <div class="container"> <h1>Section One</h1> <p> Demo Section</p> </div> </div> <div id="sectionTwo"> <div class="container"> <h1>Section Two</h1> <p> Demo Section</p> </div> </div> <div id="sectionThree"> <div class="container"> <h1>Section Three</h1> <p> Demo Section</p> </div> </div> <div id="sectionFour"> <div class="container"> <h1>Section Four</h1> <p> Demo Section</p> </div> </div> </div> </body> </html>
Copyrights@tutorialsplane.com