Shrink Nav on scroll down

<script type="text/javascript"> $(document).scroll(function () { var y = $(this).scrollTop(); if (y > 40) { $('nav').stop().addClass('shrink'); } else { $('nav').stop().removeClass('shrink'); } }); </script> <style> nav{ transition: all 0.5s; } .shrink{ padding: 10px 0 10px 0; } </style>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.