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

前端 未结 13 1669
情话喂你
情话喂你 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条回答
  •  旧时难觅i
    2020-11-29 04:39

    I figure out the answer! You need to use the window.onload function as shown below. Thanks to Tec guy and Karim for the help. Note: You still need to use the document ready function too.

    window.onload = function() {$('#logo').hide().fadeIn(3000);};
    $(function() {$("#div").load(function() {$('#div').hide().fadeIn(750);); 
    

    It also worked for me when placed right after the image...Thanks

提交回复
热议问题