Line 1,447: | Line 1,447: | ||
var isFixed = ($element.css('position') == 'fixed'); | var isFixed = ($element.css('position') == 'fixed'); | ||
− | if ($(this).scrollTop() > headerHeight { | + | if ($(this).scrollTop() > headerHeight) { |
− | + | if(!isFixed) { | |
− | + | console.log('scroll'); | |
+ | $element.addClass("scrolled"); | ||
+ | } | ||
} | } | ||
− | if ($(this).scrollTop() < headerHeight { | + | if ($(this).scrollTop() < headerHeight) { |
− | + | if(isFixed) { | |
− | + | console.log('dont scroll'); | |
+ | $element.removeClass("scrolled"); | ||
+ | } | ||
} | } | ||
}); | }); |
Revision as of 15:25, 5 October 2016