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.
- Load page, (wait until all content/images are loaded before running function).
- Wait 4 seconds then fade out #loader div.
- 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");
});
精彩评论