Skip to content

Instantly share code, notes, and snippets.

@prrraveen
Created March 1, 2016 05:47
Show Gist options
  • Select an option

  • Save prrraveen/172e7cb02cb8e56cfb06 to your computer and use it in GitHub Desktop.

Select an option

Save prrraveen/172e7cb02cb8e56cfb06 to your computer and use it in GitHub Desktop.
toggle navbar between transparent and flat ui
.navigation.transparent{
margin: 0 auto;
overflow: hidden;
font-weight: 600;
background-color: rgba(0,0,0,0.25);
border-color: transparent;
// color: #fff !important;
@include border-radius(0px);
@include box-shadow(0 0 0 0);
a {
// color: $text-two !important;
}
a:hover,a:focus{
font-size: 17px;
color: $turquoise !important;
}
}
$(document).ready(function(){
var apply_on_scroll = function(){
/**
*
* initially the nav bar is transparent to keep the image uncluttered. but if user scrolls down. A flat ui nav bar is displayed.
*
*/
var _this = $('.navigation');
_this.addClass('transparent navbar-fixed-top');
$(window).scroll(function (event) {
var scroll = $(window).scrollTop();
if(scroll > 150){
_this.removeClass('transparent');
}
else {
_this.addClass('transparent');
}
});
}();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment