Show Loader while load URL in div in jQuery Ajax

I am facing an issue while load URL in DIV, I want to display loader in DIV until the DIV URL is not fully load.
I use timeout but it not works as expected…
What I do in this situation… Please help me to provide the script for understanding…

Thank You

setTimeout(function() {
$("div.myDiv").find("div.loaderArea").fadeOut("slow",function() {
$("div.containt").load('data.php').addClass("animated fadeIn");
});
}, 3000);
hide_full_loader(); //function

jQuery’s load() method provides a callback which is executed after HTML insertion has been performed. This might be a good place to remove the spinner.

For example (untested):

$('div.myDiv')
  .find('div.loaderArea')
  .fadeOut('slow', function() {
    $('div.containt')
      .addClass('animated fadeIn')
      .load('data.php', function(){ // remove spinner here });
  });

P.S. You have a typo in your class name: containt should probably be content.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.