Show loading image while Page is loading using jQuery - Mostlikers

08 December, 2014

Show loading image while Page is loading using jQuery

Sometime page loading take too much time. that case page show empty blank page Would it not be nice to show loading images or message while your page is loading. below i have shared script follow that one make your site standard.

page loading image

<html>
    <head>
    <title>Mostlikers</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $(".loading").fadeOut(3000);
    });
    </script>
    <style type="text/css">
        .loading {
        background: url('loading_1.gif') no-repeat center;  
        position: fixed;
        left: 0px;
        top: 0px;
        width: 100%;
        height: 100%;
        z-index: 1000;
        }
    </style>
    </head>
    <body>
        <div class="loading"></div>
    </body>
</html>

1 comment: