Horje Website
Bs Scrollspy Stacked – Bootstrap Scrollspy – Bootstrap Scrollspy – Bootstrap Code

Bs Scrollspy Stacked – Bootstrap Scrollspy

Bs Scrollspy Stacked - Bootstrap Scrollspy - Bootstrap Scrollspy - Bootstrap Code


 
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Bootstrap Example</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  9. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  10. <style>
  11. body {
  12. position: relative;
  13. }
  14. #section1 {padding-top:50px;height:500px;color: #fff; background-color: #1E88E5;}
  15. #section2 {padding-top:50px;height:500px;color: #fff; background-color: #673ab7;}
  16. #section3 {padding-top:50px;height:500px;color: #fff; background-color: #ff9800;}
  17. #section41 {padding-top:50px;height:500px;color: #fff; background-color: #00bcd4;}
  18. #section42 {padding-top:50px;height:500px;color: #fff; background-color: #009688;}
  19. </style>
  20. </head>
  21. <body data-spy="scroll" data-target=".navbar" data-offset="50">
  22. <nav class="navbar navbar-inverse navbar-fixed-top">
  23. <div class="container-fluid">
  24. <div class="navbar-header">
  25. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
  26. <span class="icon-bar"></span>
  27. <span class="icon-bar"></span>
  28. <span class="icon-bar"></span>
  29. </button>
  30. <a class="navbar-brand" href="#">WebSiteName</a>
  31. </div>
  32. <div>
  33. <div class="collapse navbar-collapse" id="myNavbar">
  34. <ul class="nav navbar-nav">
  35. <li><a href="#section1">Section 1</a></li>
  36. <li><a href="#section2">Section 2</a></li>
  37. <li><a href="#section3">Section 3</a></li>
  38. <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Section 4 <span class="caret"></span></a>
  39. <ul class="dropdown-menu">
  40. <li><a href="#section41">Section 4-1</a></li>
  41. <li><a href="#section42">Section 4-2</a></li>
  42. </ul>
  43. </li>
  44. </ul>
  45. </div>
  46. </div>
  47. </div>
  48. </nav>
  49. <div id="section1" class="container-fluid">
  50. <h1>Section 1</h1>
  51. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  52. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  53. </div>
  54. <div id="section2" class="container-fluid">
  55. <h1>Section 2</h1>
  56. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  57. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  58. </div>
  59. <div id="section3" class="container-fluid">
  60. <h1>Section 3</h1>
  61. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  62. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  63. </div>
  64. <div id="section41" class="container-fluid">
  65. <h1>Section 4 Submenu 1</h1>
  66. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  67. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  68. </div>
  69. <div id="section42" class="container-fluid">
  70. <h1>Section 4 Submenu 2</h1>
  71. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  72. <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p>
  73. </div>
  74. </body>
  75. </html>



Try Your Self ->



Published:
October 4, 2020
Author:
admin
Category:
Bootstrap 3, Bootstrap Source Code
Views:
13

This article was posted in Bootstrap 3, Bootstrap Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2022