Answer the question
In order to leave comments, you need to log in
How to animate class change?
Ku Ku.
I installed a simple navbar stick that changes when you scroll. Here is his code:
$(function(){
var $window = $(window);
var $mainNav = $("#header");
$window.scroll(function() {
if ($window.scrollTop() >= 1) {
$mainNav.addClass("is-scrolling");
}
else {
$mainNav.removeClass("is-scrolling");
}
});
});
jQuery(window).scroll(function(){
"use strict";
var b = jQuery(window).scrollTop();
if( b > 60 ){
jQuery("#header").addClass("is-scrolling");
} else {
jQuery("#header").removeClass("is-scrolling");
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question