When I call $("body").animate({scrollTop: someValue});
I want $(window).scroll(function() { });
to be called too. How can I achieve that?
I have tried with $(window).trigger("scroll")
and $(window).triggerHandler("scroll")
without success.
EDIT:
Problem solved. There was an if
in my $(window).scroll(function() { });
that caused the problem.
Just use:
// Trigger the scroll event
$(window).scroll();
Source: