Horje Website
Bs Affix2 Stacked – Bootstrap Affix – Bootstrap Affix – Bootstrap Code

Bs Affix2 Stacked – Bootstrap Affix

Bs Affix2 Stacked - Bootstrap Affix - Bootstrap Affix - Bootstrap Code


 
  1. <!DOCTYPE html>
  2. <html lang="en">
  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. /* Note: Try to remove the following lines to see the effect of CSS positioning */
  12. .affix {
  13. top: 20px;
  14. z-index: 9999 !important;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <div class="container-fluid" style="background-color:#2196F3;color:#fff;height:200px;">
  20. <h1>Bootstrap Affix Example</h1>
  21. <h3>Fixed (sticky) vertical sidenav on scroll</h3>
  22. <p>Scroll this page to see how the left navigation menu behaves with data-spy="affix".</p>
  23. <p><strong>The left menu sticks to the page when you have scrolled a specified amount of pixels.</strong></p>
  24. </div>
  25. <br>
  26. <div class="container">
  27. <div class="row">
  28. <nav class="col-sm-3">
  29. <ul class="nav nav-pills nav-stacked" data-spy="affix" data-offset-top="205">
  30. <li class="active"><a href="#section1">Section 1</a></li>
  31. <li><a href="#section2">Section 2</a></li>
  32. <li><a href="#section3">Section 3</a></li>
  33. </ul>
  34. </nav>
  35. <div class="col-sm-9">
  36. <h1>Some text to enable scrolling</h1>
  37. <h1>Some text to enable scrolling</h1>
  38. <h1>Some text to enable scrolling</h1>
  39. <h1>Some text to enable scrolling</h1>
  40. <h1>Some text to enable scrolling</h1>
  41. <h1>Some text to enable scrolling</h1>
  42. <h1>Some text to enable scrolling</h1>
  43. <h1>Some text to enable scrolling</h1>
  44. <h1>Some text to enable scrolling</h1>
  45. <h1>Some text to enable scrolling</h1>
  46. <h1>Some text to enable scrolling</h1>
  47. <h1>Some text to enable scrolling</h1>
  48. <h1>Some text to enable scrolling</h1>
  49. <h1>Some text to enable scrolling</h1>
  50. </div>
  51. </div>
  52. </div>
  53. </body>
  54. </html>



Try Your Self ->



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

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 - 2023