How to apply Transition when adding and remove class on this scroll js below:
lastScroll = 0;
$(window).on('scroll',function() {
var scroll = $(window).scrollTop();
if(scroll === 0){
$(".header").removeClass("shrink");
} else if(lastScroll - scroll > 0) {
$(".header").addClass("shrink");
} else {
$(".header").removeClass("shrink");
}
lastScroll = scroll;
});
Trying to add this ({'transitionTime': 200})
when add and remove class.
Main Fiddle: http://jsfiddle.net/9fbr320y/1/
Example Here: Link >>