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

前端 未结 13 1604
情话喂你
情话喂你 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:41

    Like Sohne mentions, but I would add this:

    $("img").hide();
    
    $("img").bind("load", function () { $(this).fadeIn(); });
    

    or:

    $("img").bind("load", function () {
     $(this).css({opacity: 0, visibility: "visible"}).animate({opacity: 1}, "slow"); 
    });
    

提交回复
热议问题