开发者

Fade out and fade in not working in Opera

Please forgive me since I'm new to Jquery/Javascript. I've created a simple code that seems to work fine in: IE9, Firefox, Safari, Chrome. But for some reason its not working in Opera. The #loader div doesn't seem to fade away.

This is the code:

$(window).load(function () {

$("#loa开发者_StackOverflow社区der").delay(4000).fadeOut("slow"); $("p").delay(5000).fadeIn("slow"); });

The code functions as follows.

  1. Load page, (wait until all content/images are loaded before running function).
  2. Wait 4 seconds then fade out #loader div.
  3. Finally fade in paragraph after 5 seconds.

Thanks in advance!


Change $(window).load to $(document).ready. I don't think your fadeIn/fadeOut methods are even being called right now. Full example below:

$(document).ready(function () {
  $("#loader").delay(4000).fadeOut("slow"); 
  $("p").delay(5000).fadeIn("slow"); 
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜