首页>>Jquery图片>>js原生延迟加载(2021-11-22)

js原生延迟加载

js原生延迟加载
赞赏支持
立刻微信赞赏支持 关闭

 

XML/HTML Code
  1. <div class="con">  
  2.             <img _src="https://picsum.photos/id/1/200/300"alt="">  
  3.             <img _src="https://picsum.photos/id/2/200/300"alt="">  
  4.             <img _src="https://picsum.photos/id/3/200/300"alt="">  
  5.             <img _src="https://picsum.photos/id/4/200/300"alt="">  
  6.         </div>  
  7.         <div class="con test">  
  8.             <div class="test">  
  9.                 <img _src="https://picsum.photos/id/100/200/300"alt="">  
  10.                 <img _src="https://picsum.photos/id/101/200/300"alt="">  
  11.             </div>  
  12.             <img _src="https://picsum.photos/id/102/200/300"alt="">  
  13.             <img _src="https://picsum.photos/id/103/200/300"alt="">  
  14.               
  15.             <img _src="https://picsum.photos/id/104/200/300"alt="">  
  16.             <img _src="https://picsum.photos/id/108/200/300"alt="">  
  17.             <img _src="https://picsum.photos/id/106/200/300"alt="">  
  18.         </div>  

 

JavaScript Code
  1. <script type="text/javascript">  
  2.         LazyLoad("img", {  
  3.             attr: "_src",   
  4.             th: 100,  
  5.         });  
  6.     </script>  

 


原文地址:http://www.freejs.net/article_jquerytupiantexiao_924.html