Hi, I have an issue with a little piece of code only in page builder ( everything works fine on the "live" version of the pages"
I would like to add a page loader, which disappears when the page is loaded, pretty simple feature .. But when i'm in page builder, ( i guess ) the scipt is not executed, so the loader doesn't disappear
$('body').append('<div style="" id="loadingDiv"><div class="loader">Loading...</div></div>');
$(window).on('load', function(){
setTimeout(removeLoader, 2000); //wait for page load PLUS two seconds.
});
function removeLoader(){
$( "#loadingDiv" ).fadeOut(500, function() {
// fadeOut complete. Remove the loading div
$( "#loadingDiv" ).remove(); //makes page more lightweight
});
}
I have tried to hide it when when the body tag of the page has class .page-editor, but without success