Hi

I wonder how to create some preloder text/img that shows while fetching data. I have a simple link as index.php?data=26 that gets data from db and would like to show some text/gif while fetching data. When data is loaded then text/gif disappear from the pages.

Can this be done some simple way with php or javascript?

    Hi, looks very nice. It is something like that i would like to show. Som text like "loading..please hold" or just some "loading images". I guess it is to much for me to create similar or at least i have to rewrite almost everyting and start from begening.

    I made this with jQuery (probably very uglu code) but dont know if it do same thing. It seems working but problem is it shown even if I click on links that have nothing to do with getting data from database and just shown everytime page reloads or click on some link.

    He here is the code

    <script type="text/javascript">
    $(document).ready(function() {
    $("#preloader").css( "visibility","visible" );
    });
    </script>
    
    <script type="text/javascript">
    $(window).load(function() {
    $('#preloader').fadeOut('slow');
    });
    </script>

    test css looks: (visibility: is hidden as default in css so if javascript is disabled it will be hidden and not show any loading text/images on the pages unnecessarily.)

    #preloader {
    visibility: hidden;
    position: fixed;
    top:15%;
    left:15%;
    padding: 0px 22px 0px 5px;
    background: #c6d6c2 url(ajax-loader.gif) no-repeat right center; 
    }

    and html

    <div id="preloader">Loading... Please Wait.</div>

    What do you think, is it proper made?

      Write a Reply...