SKammerman (Talk | contribs) |
SKammerman (Talk | contribs) |
||
Line 8: | Line 8: | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</head> | </head> | ||
Line 27: | Line 19: | ||
#bodyContent h1, #bodyContent h2, #bodyContent h3, #bodyContent h4, #bodyContent h5 { margin-bottom: 0px; | #bodyContent h1, #bodyContent h2, #bodyContent h3, #bodyContent h4, #bodyContent h5 { margin-bottom: 0px; | ||
− | + | .affix { | |
− | + | top: 20px; | |
− | + | } | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | } | + | |
− | |||
− | |||
− | |||
</style> | </style> | ||
Line 46: | Line 30: | ||
<body> | <body> | ||
− | <div class="container" | + | <div class="container-fluid" style="background-color:#2196F3;color:#fff;height:200px;"> |
− | < | + | <h1>Bootstrap affixed.bs.affix</h1> |
− | + | <p>Scroll down this page.</p> | |
− | </ | + | <p><strong>The affixed.bs.affix event occurs when the .affix-top class has been replaced with the .affix class.</strong></p> |
</div> | </div> | ||
+ | <br> | ||
<div style="margin-top:100px"></div> | <div style="margin-top:100px"></div> | ||
Line 153: | Line 138: | ||
</div> <!--END container--> | </div> <!--END container--> | ||
</body> | </body> | ||
+ | |||
+ | <script> | ||
+ | $(document).ready(function(){ | ||
+ | $('.nav').affix({offset: {top: 150} }); | ||
+ | $('.nav').on('affixed.bs.affix', function(){ | ||
+ | alert('The navigation menu is about to be affixed - The .affix-top class has been replaced with the .affix class'); | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | |||
+ | </html> |
Revision as of 20:15, 22 October 2017
Bootstrap affixed.bs.affix
Scroll down this page.
The affixed.bs.affix event occurs when the .affix-top class has been replaced with the .affix class.