Line 37: | Line 37: | ||
+ | nav.navbar{ | ||
+ | background-color:#ccc; | ||
+ | // Animation | ||
+ | -webkit-transition: all 0.4s ease; | ||
+ | transition: all 0.4s ease; | ||
+ | } | ||
+ | nav.navbar.shrink { | ||
+ | min-height: 35px; | ||
+ | } | ||
</style> | </style> | ||
− | + | <script> | |
− | + | $(window).scroll(function() { | |
+ | if ($(document).scrollTop() > 50) { | ||
+ | $('nav').addClass('shrink'); | ||
+ | } else { | ||
+ | $('nav').removeClass('shrink'); | ||
+ | } | ||
+ | }); | ||
+ | </script> | ||
Line 101: | Line 117: | ||
</nav> | </nav> | ||
− | + | <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> | |
</body> | </body> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> | ||
</html> | </html> |
Revision as of 12:26, 11 October 2016