Animation stops while page is loading in safari
I have a site that is experiencing some slow load times that i'm trying to diagnose and fix. In the meantime I've set up a loading that animates across the bottom of the page as soon as a user clicks to navigate to a new page. This works great in every browser expect Safari (both mobile and desktop). I have verified that the animation itself works in Safari by adding starting the animation on page load. The problem is that as soon as you click to navigate the animation stops. Is there any way around this or is it just a product of the way Safari works.
Just in case here is the code:
$(".startLoad").click(function () {
loading()
});
function loading() {
$(".loader").css("margin-left", "-100%");
$(".loader").animate({ marginLeft: "100%" }, 1000, loading);
}
Thanks,
Owen