let loading = document.getElementByid("#id");

let isLoading = false; 

let obser = new IntersectionObserver(function(value) {

  let value = value[0];

  if (value.isIntersecting && !isLoading) {

    // 进行加载

  }

},{

  thresholds: 0.3 //重叠30%面积时

});

 

// 例子

obser.observe(loading);