I always use a spinner from ajaxload.info first I show the spinner and then I hide it when the page completely loaded. But I was trying to create a spinner like youtube does without any luck.
How can I get the time in milliseconds that spent the image to load. In this scenario I should pass the value of millisecond to my animate
jquery function.
This is my code:
$( "#some-image" ).animate({
width: "100%"
}, 5000);//duration
$('#some-image').load(function() {
$( "#spinner" ).hide();
});