jQuery How do you get an image to fade in on load?

前端 未结 13 1602
情话喂你
情话喂你 2020-11-29 04:21

All I want to do is fade my logo in on the page loading. I am new today to jQuery and I can\'t managed to fadeIn on load please help. Sorry if this question has already been

13条回答
  •  [愿得一人]
    2020-11-29 04:29

    To do this with multiple images you need to run though an .each() function. This works but I'm not sure how efficient it is.

    $('img').hide();
    $('img').each( function(){
        $(this).on('load', function () {
            $(this).fadeIn();
        });
    });
    

提交回复
热议问题