"Fixed Scroll With Jquery"
Bootstrap 3.3.0 Snippet by akhsya

<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 ----------> <header class="parallax"> <nav class="navbar navbar-default navbar-fixed-top tembus"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Indonesia Youth Dream</a> </div> <div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav navbar-right"> <li><a href="#" class="hvrcenter">Home</a></li> <li><a href="#" class="hvrcenter">About</a></li> <li><a href="#" class="hvrcenter">TimeLine</a></li> </ul> </div> </div> </nav> </header> <div ></div> <div style="height:1000px;background-color:blue;font-size:36px"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div>
.parallax { background-image: url("https://2.bp.blogspot.com/-BbZ9vrRQulE/VsRHKphjSPI/AAAAAAAAEIo/pUMajal5y2E/s1600/9210_10204036116783004_2895822434590794652_n.jpg"); min-height: 500px; background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover; } .navbar-default{ background-color: #e74c3c !important; } .navbar-default .navbar-header > a { color: #ecf0f1 ; } .navbar-default .navbar-nav > li > a{ color:#ecf0f1 ; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { border-bottom: 2px solid #ecf0f1; background-color: transparent; } .merah{ background-color: #e74c3c !important; } .tembus{ background-color: transparent !important; }
$(window).scroll(function(){ var scrol = $(window).scrollTop(); if (scrol >= 500) { $(".navbar-default").removeClass('tembus'); }else{ $(".navbar-default").addClass("tembus"); } });

Related: See More


Questions / Comments: