Show loading indicator with jQuery

后端 未结 4 514
时光说笑
时光说笑 2021-01-07 00:54

I have a

with an image slider in an
  • . There are 12 images, and it takes some time to load all of them. While the images load,
  • 4条回答
    •  情歌与酒
      2021-01-07 01:26

      if u loading all images via AJAX then use below way

      HTML

      jQuery

      $('#loadingDiv')
          .hide()  // hide it initially
          .ajaxStart(function() {
              $(this).show();
          })
          .ajaxStop(function() {
              $(this).hide();
          })
      ;
      

    提交回复
    热议问题