Show loading indicator with jQuery

后端 未结 4 472
时光说笑
时光说笑 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:03

      You can use the jQuery load() function. It will run the code once the image has loaded. So if you have a gif shown, once the image has loaded, it will hide it.

      Javascript

      $('img#id').load(function(){
          $('#loadingGif').hide();
      });
      

      HTML

    提交回复
    热议问题