1

Possible Duplicate:
How to show loading spinner in jQuery?

In the below screenshot till the required content is loaded it displays an image that represents loading. I saw this even while loading web pages first it displays the page loading image and at once the loading image turns to page. How this can be implemented? enter image description here

1

1 Answer 1

0
$.ajaxStart(function(){
    $("#loader_with_image").show();
});

$.ajaxComplete(function(){
    $("#loader_with_image").hide();
});
4
  • Well is #loader_with_image the DIV layer that consists of image or some other?
    – Mal
    Sep 12, 2011 at 14:05
  • @Kars: yes, div with loading image
    – genesis
    Sep 12, 2011 at 14:14
  • How should I declare this in HTML page? should I use <script type="text/javascript"></script> tag or any other?
    – Mal
    Sep 12, 2011 at 14:26
  • @Kars: yes. after including jquery and #loader_with_image
    – genesis
    Sep 12, 2011 at 14:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.