Prev Demo
Affix-Top.Bs.Affix
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <style> .affix { top: 20px; } </style> </head> <body> <div class="container-fluid" style="background-color:green;color:white;height:200px;"> <h2>SN ITFunda</h2> <p> SN ITFunda service is a software company which has websites to provide .NET training for people </p> </div> <br /> <div class="container"> <div class="row"> <nav class="col-sm-3"> <ul class="nav nav-pills nav-stacked"> <li class="active"><a href="#">DotNetFunda</a></li> <li><a href="#">TechFunda</a></li> <li><a href="#">ItFunda</a></li> <li><a href="#">kidsFunda</a></li> <li><a href="#">FarmingFunda</a></li> </ul> </nav> <div class="col-sm-9"> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> <h2>Training</h2> </div> </div> </div> <script> $(document).ready(function () { $('.nav').affix({ offset: { top: 300 } }); $(".nav").on('affix-top.bs.affix', function () { alert('Welcome to TechFunda') }); }); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output