Agregar y eliminar clase cuando se haga Scroll

/*Add and remove class on scroll for dynamic fixed header height*/ jQuery(window).scroll(function() { var scroll = jQuery(window).scrollTop(); if (scroll >= 300) { jQuery("#header_wrap").addClass("fixed_navigation animated fadeInDown"); jQuery("#back-top").addClass("go_top_active animated fadeInUp"); } else { jQuery("#header_wrap").removeClass("fixed_navigation animated fadeInDown"); jQuery("#back-top").removeClass("go_top_active animated fadeInUp"); } });

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.