twitter-bootstrap Bootstrap Affix On Navbar


Example

Html:

<nav class="navbar navbar-defalt" data-offset-top="120" data-spy="affix" >
    ...
</nav>

Css:

<style>
.navbar {
    background-color: red;
}
.navbar.affix {
    background-color: green;
}

</style>