Fixed nav dropdown bg

This commit is contained in:
Asutosh Palai
2016-07-05 03:48:41 -04:00
parent e3b45e18a7
commit 8164feca14
2 changed files with 17 additions and 12 deletions

View File

@ -5,18 +5,18 @@ $(function() {
var imgClass = (this.width/this.height > parent.width()/parent.height()) ? 'wide' : 'tall';
$(this).addClass(imgClass);
})
});
$(window).scroll(function() {
var scroll = $(window).scrollTop();
var fTop = $('#new-articles').position().top + $('#new-articles').height();
if (scroll >= fTop) {
$(".navbar-wrapper").addClass("darken");
var switchPos = $('#new-articles').position().top + $('#new-articles').height();
} else {
$(".navbar-wrapper").removeClass("darken");
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= switchPos) {
$(".navbar-wrapper").addClass("darken");
}
} else {
$(".navbar-wrapper").removeClass("darken");
}
});
});
function onYouTubeIframeAPIReady() {