Thursday, March 10, 2011

Javascript Preloader

Well this javascript function is called on body onload
that basically hide the div having loading image when the when the body loads before that it keep showing the image

you javscript function for this :

  <script type="text/javascript">

        function is_loaded()
            if (document.getElementById)
                    if (document.layers)
                 { //NS4
                   document.preloader.visibility = 'hidden';
                    { //IE4
               = 'hidden';

After this replace your body tag with this

<body onload="is_loaded();">

and in you html insert this div ::

<div id="preloader"  style="position:absolute; left:-5%; top:70px; width:350px; height:120px; text-align:center"> <center> <div><img src="images/loading-gif.gif" /></div> </center> </div>

replace the src of image accordingly or you can have simple plain text also!!!

No comments:

Post a Comment