Using JQuery Display Loading Image While Page Loads for PHP, ASP.Net, HTML
-
Select loading .gif image.
-
Add the following div tag in html body element possibly immediately after start body tag : <div class="page_load"></div>
-
Add CSS to in head tag : .loader { position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 9999; background: url('images/loader.gif') 50% 50% no-repeat rgb(255,255,255); }
-
Add jquery in the head tag : <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> $(window).load(function() { $(".page_load").fadeOut("slow"); }) </script>
You may also like :