I have a function which runs based on a setInterval()
call. It looks like this:
function update()
{
destinationY = targetPage.offset().top - $("div#reel").offset().top;
currentY -= (currentY - destinationY) / REEL_EASE;
$(document).scrollTop(currentY);
}
This updates the position of the document constantly to give the effect of a sliding animation, sliding towards certain points which are stored by the navigation items.
I want to not run the above code if the scrollbar has been clicked on the page. How can I call a method when the scrollbar is clicked?