I have a web page that uses a "preloader" spinner animation with the following code:
window.onload = function() {
"use strict";
var preloader = $('#loading'),
loader = preloader.find('#loading-center-absolute');
loader.fadeOut();
preloader.delay(400).fadeOut('slow');
};
This works fine for all .html except for the one that has a <iframe> YouTube embedded video:
<iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>
In this page, the preloading spinner never ends. Maybe the <iframe> is calling a kind-of onLoad function internally and the loading falls in an infinite loop.
How can I avoid this behavior without deleting the preloading spinner?
Thanks!