Load Dokumen JavaScript
window.addEventListener("load", function(event) {
console.log("Tutte le risorse hanno terminato il caricamento!");
});
Sticky Pingu
window.addEventListener("load", function(event) {
console.log("Tutte le risorse hanno terminato il caricamento!");
});
window.onload = function() {
// Some code
};
window.addEventListener('load', (event) => {
console.log('page is fully loaded');
});
window.onload = (event) => {
console.log('page is fully loaded');
};
window.onload = function() {
// Code here
}
// loader with jaquery
$(window).on('load', function () {
$('#loading').fadeOut(1000);
});
// loader with javascript with inline
//html code
<div id="loading" onload="preload()"></div>
//javascript code
var loader= document.getElementById("loading");
loader.style.display="none"
//loader with javascript with custom time
var loader = document.getElementById("loading");
window.addEventListener("load", function () {
setTimeout(function () {
loader.style.display = "none"
},5000)
})