"TEST: Simple animated navbar"
Bootstrap 3.3.0 Snippet by mrmccormack

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!-- Begin Navbar --> <div id="nav"> <div class="navbar navbar-inverse navbar-fixed-top" data-spy="affix" data-offset-top="100"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><img class="img-responsive logo" src="https://cdn4.iconfinder.com/data/icons/adore/118/Camera.png" alt=""></a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li class="active"><a href="#">Home</a> </li> <li><a href="#about">About</a> </li> <li><a href="#contact">Contact</a> </li> </ul> </div> <!--/.nav-collapse --> </div> <!--/.contatiner --> </div> </div> <!-- Main jumbotron for a primary marketing message or call to action --> <div class="jumbotron"> <div class="container"> <h2>On-scroll<small> header effects</small></h2> <p> <p>Best viewed <a href="http://bootsnipp.com/iframe/z1Dx8" target="_blank">full screen</a></p> <p>??? Mobile dropdown now working... This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p> <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a> </p> </div> </div> <div class="container"> <!-- Example row of columns --> <div class="row"> <div class="col-md-4"> <h2>Heading</h2> <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> <p><a class="btn btn-default" href="#" role="button">View details »</a> </p> </div> <div class="col-md-4"> <h2>Heading</h2> <img src="http://i.imgur.com/DLScdiR.jpg" class="img-responsive" alt="bird" /> <br> <p><a class="btn btn-default" href="#" role="button">View details »</a> </p> </div> <div class="col-md-4"> <h2>Heading</h2> <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.</p> <p><a class="btn btn-default" href="#" role="button">View details »</a> </p> </div> </div> <!-- /row --> <div class="container"> <!-- Example row of columns --> <div class="row"> <div class="col-md-4"> <h2>Heading</h2> <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> <p><a class="btn btn-default" href="#" role="button">View details »</a> </p> </div> <div class="col-md-4"> <h2>Heading</h2> <img src="http://i.imgur.com/DLScdiR.jpg" class="img-responsive" alt="bird" /> <br> <p><a class="btn btn-default" href="#" role="button">View details »</a> </p> </div> <div class="col-md-4"> <h2>Heading</h2> <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.</p> <p><a class="btn btn-default" href="#" role="button">View details »</a> </p> </div> </div> <!-- /row --> <hr> <footer> <p>© Company 2014</p> </footer> </div> <!-- /container -->
/* CSS used here will be applied after bootstrap.css Ref: http://www.bootply.com/d8RMa03wW7 */ html,body { height:100%; padding-top:70px; } section { height:calc(90% - 50px); } .affix { padding:0px; -webkit-transition:padding 0.2s linear; -moz-transition:padding 0.2s linear; -o-transition:padding 0.2s linear; transition:padding 0.2s linear; } .affix-top { padding-top:15px; padding-bottom:15px; -webkit-transition:padding 0.5s linear; -moz-transition:padding 0.5s linear; -o-transition:padding 0.5s linear; transition:padding 0.5s linear; }
$(window).scroll(function() { if ($(document).scrollTop() > 150) { alert('hi'); $('.logo').height(200); } else { $('.logo').height(100); });

Related: See More


Questions / Comments: