1

I would like my preloader to add the class fade out which changes the opacity revealing the site behind it. I would like to guarantee that my hero image has loaded before this happens though. Can I check if an image has loaded then add class to my preloader?

$('#hidden-image img').on('load', function () {
    $('.first-preloader').addClass('fade-out')
});

0 Answers0