Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Internet Explorer的IntersectionObserver未定义_Javascript_Html_Internet Explorer_Intersection Observer - Fatal编程技术网

Javascript Internet Explorer的IntersectionObserver未定义

Javascript Internet Explorer的IntersectionObserver未定义,javascript,html,internet-explorer,intersection-observer,Javascript,Html,Internet Explorer,Intersection Observer,我有一个IntersectionObserver来延迟加载图像等,其中el是HTML元素,offset是一个数字 const observer = new IntersectionObserver((entries) => { if (entries[0].isIntersecting === true) { el.srcset = this.image; observer.unobserve(el); } }, {threshold: [0], rootMargi

我有一个IntersectionObserver来延迟加载图像等,其中
el
是HTML元素,
offset
是一个数字

const observer = new IntersectionObserver((entries) => {
  if (entries[0].isIntersecting === true) {
    el.srcset = this.image;
    observer.unobserve(el);
  }
}, {threshold: [0], rootMargin: this.offset + 'px'});

observer.observe(el);
此观察器在每个浏览器上都能正常工作,但在IE11上不能正常工作。调试它时返回以下错误:

“交叉点观察者”未定义


这使得图像根本无法加载。IE有解决方案吗?既然我认为IE不支持它,那么正常的行为不应该是最初执行观察者的代码吗

InternetExplorer中不支持IntersectionObserver。 您可以参考以下链接以供参考。
IE不支持IntersectionObserver。您可以参考。如果你想在IE中支持它,你可以使用。此库在不支持浏览器的情况下多填充本机
IntersectionObserver
API