Jquery .load & amp; .html Charging Time Issue

advertisements

Another issue I seem to be having is with Jquery again. I'm basically loading in content from external php pages, by using the .load function. This works fine, the only issue I have is the load just flashes in and out, so it doesn't look very good.

Is there anyway to get the loader to display for longer, or at least a min amount of time?

Here's the code I currently have:

 $('#content').load('contact.php');
        $('#test a').click(function() {
        var page = $(this).attr('href');
        $("#mydiv").html('<div class="bar"><span></span></div>');
        $('#content').load(''+ page +'.php', null, function() {
    $("#mydiv").html('');
   });
    return false;
});

Any help or guidance would be great :)

The following did not work :

<script type="text/javascript">
    $(document).ready(function() {

    setTimeout(function () { 

    $('#content').load('contact.php');

    $('#test a').click(function() {

    var page = $(this).attr('href');

        $("#mydiv").html('<div class="bar"><span></span></div>');
    $('#content').load(''+ page +'.php', null, function() {
    $("#mydiv").html('');
    });

    return false;

        }); 

    }, 2000);

});
</script>


<script>
    setTimeout(function () {
        //Do it here
    }, 2000);
</script>

I would not make an user wait one minute though. Modify the 2000 to whatever time you want.

Good luck.