Hi, I want to make such a script that, When the user clicks login, a GIF image is displayed untill the whole page is loaded or atleast for about 5 seconds and loading the pages is in the background.Much like it is in gmail and paypal. how can this be done??I was thinking of some function like onCompleteLoad as we use <body onLoad=function()> or some other meathod
You can do it easily with jQuery like this: http://www.drk.com.ar/docs/photos/villa-de-merlo-san-luis-argentina.php You have to add a DIV with an id like loading to show the loading message. And another DIV with the actual content which should start with style display: none; using another id. Then bind the onload event with jQuery and switch visible and insivible DIVs: <script type="text/javascript" > $(document).ready(function(){ $('#loading').addClass('hidden'); $('#contenido').removeClass('hidden'); }); </script> Code (markup):