I am having trouble with jQuery and wrapping my animation inside hashchange event. When event is triggered animation happens instantly. I need it to be smooth.
jQuery( document ).ready(function() {
jQuery(window).on('hashchange', function() {
jQuery('body').animate({ scrollTop: jQuery(window.location.hash).offset().top}, 'slow');
});
});
Everythings is fine if i don't wrap animation inside a hashchange event...