Page Loading Effects with jQuery
JQuery is really a powerful and handy JavaScript library. The page or content loading effect is very easy to implement in jQuery. Here’s a example to make your web page content display a fade in page loading effect. It will make your reader a shock impression. ![]()
The idea is simple ~
1. Create a div block with content hide
This div block is use to implement content fade in page loading effect.
<div id="page_effect" style="display:none;"> <!-- this content is hide, need jQuery to fade in --> </div>
2. jQuery fadeIn effect
Create a jQuery fadeIn effect when document is ready to display
$(document).ready(function(){
$('#page_effect').fadeIn(2000);
});P.S fadeIn() is the jQuery library build in function.
3. Demo
Complete jQuery codes to implement the fade in loading effect.
<html> <head> <title>JQuery Page Loading Effect</title> <script type="text/javascript" src="jquery.js"></script> </head> <script type="text/javascript"> $(document).ready(function(){ $('#page_effect').fadeIn(2000); }); </script> <body> <div id="page_effect" style="display:none;"> <h1>JQuery Page Loading Effect</h1> This is page loading effect with JQuery 1<BR> This is page loading effect with JQuery 2<BR> This is page loading effect with JQuery 3<BR> This is page loading effect with JQuery 4<BR> This is page loading effect with JQuery 5<BR> This is page loading effect with JQuery 6<BR> This is page loading effect with JQuery 7<BR> This is page loading effect with JQuery 8<BR> This is page loading effect with JQuery 9<BR> This is page loading effect with JQuery 10<BR> This is page loading effect with JQuery 11<BR> This is page loading effect with JQuery 12<BR> This is page loading effect with JQuery 13<BR> This is page loading effect with JQuery 14<BR> </div> </body> </html>
what do you mean, you just fadeIn a div after the page has finished loading and you call it loading effect? i thought you can do better than that to write a code that displays “waiting” whilst the page. you are a disappointment and disceiptful
FadeIn is a loading effect, it’s not a advance technique but simple and nice.
Thanks for this, my site looks great.
If you wrap your page with display:none, your page will not load when visitors have javascript disabled.
Use jQuery to add display:none css property to the body… use the script below and no div container is needed, your page will have the nice loading effect when javascript is enable and will still display without javascript.
nice inputs and great suggestion, thanks Yvonne.
bueno y sencillo, gracias. (Google translated : good and simple, thanks.)
HI,
Thanks to share nice article.
Awesome, thanks allot. This really saved me some time figuring this out.
How do you do this with an image instead of a DIV element?
Thanks a lot, good one!!
[...] Page Loading Effects with jQuery In this short and easy to follow tutorial you will learn how to implement a nice fade in page [...]
Thank you for the script.
Note : the script has to be in the body, hasn’t it ?
Recommended to put in the body.
great tutorial thnx jQuery!
great tip, thanks
I did something similar to my website but noticed the effect of loading does not run well when you have many images and other stuff in the page, also, as usual, the quality in IE sucks… at least the way I did it…
and remove -> display:none
how to get the loading images on it?
Yes, and what if Javascript is disable…
You should use JS to hide AND show your page.
awesome
For some reason it does not work with Lightbox, other than that– it works great.
Anyone encountered this?
Thank you… It was very easy to implement.
Perfect…
This great..
Thank you so much…