Implement code review suggestions

This commit is contained in:
Bartlomiej Pluta (PGS Software)
2018-04-03 10:58:20 +02:00
parent 8d6893d640
commit af83bd5384
8 changed files with 66 additions and 66 deletions

View File

@@ -2,11 +2,12 @@
'use strict';
var scrollTop = 0;
var scrollThreshold = $(window).height() / 2;
$(window).scroll(function () {
scrollTop = $(window).scrollTop();
if (scrollTop >= $(window).height() / 2) {
if (scrollTop >= scrollThreshold) {
$('.navbar').addClass('navbar--shrink');
} else {
$('.navbar').removeClass('navbar--shrink');