Mikk Poles Mikk Poles - 4 months ago 25
HTML Question

Javascript codes for preloader gif remove issue

I am working on an HTML page w/ a preloader.

However for some reason when I remove a part of my JavaScript code w/c is related to preloader, the coming soon page doesnt work anymore.

Here's my JS codes:

$(window).load(function() {
/* ==============================================
PRELOADER
=============================================== */
var preloaderDelay = 500;
var preloaderFadeOutTime = 800;

function hidePreloader() {
var loadingAnimation = $('#loading-animation');
var preloader = $('#preloader');

loadingAnimation.fadeOut();
preloader.delay(preloaderDelay).fadeOut(preloaderFadeOutTime, function() {
$('#logo').addClass('animated fadeInDown');
$('.intro').addClass('animated flipInX');
$('.timerContent').addClass('animated fadeInUp');
setTimeout ( function () {
$('link[rel=stylesheet][href~="css/animate.css"]').remove();
},2000);
});
}

hidePreloader();

function startPage() {

} /* End animation section home */

});


And here's the HTML part where it handles that:

<div id="preloader">
<div id="loading-animation"></div>
</div> <!-- End Preloader -->


What should I remove on my JavaScript code to remove this preloader w/o having any issues and so that I can remove the preloader completely but not the animatoion of the logo etc.

Answer

Ok from comments I think I understood what you need:

JS :

$(window).load(function() {

    $('#logo').addClass('animated fadeInDown');
    $('.intro').addClass('animated flipInX');
    $('.timerContent').addClass('animated fadeInUp');
    setTimeout ( function () {
         $('link[rel=stylesheet][href~="css/animate.css"]').remove();
    },2000);


    function startPage() {

    } /*  End animation section home  */

});
Comments