How to check for hiding loader-a on the page?

There is such a code:

$(window).load(function() { $('#preloader-status').delay(700).fadeOut(); $('#preloader').delay(1200).fadeOut('slow'); }); 

I need to execute the function when $('#preloader') is hidden.

    2 answers 2

    For fadeOut() you can set the second parameter, which is a callback.

    For example:

     $('#preloader').delay(1200).fadeOut('slow', yourFunction); 

    The function yourFunction will be called at the end of the animation process, more detailed here .

      fadeout has a callback "animation complete".

       $("#clickme").click(function() { $("#book").fadeOut("slow", function() { // Animation complete. }); }); 

      jQuery fadeout