javascript - Check native browser support for lazy-loading images - Stack Overflow

I have a script that lazy-loads images, but since chrome 76 there is a 'native' lazy load.I&#

I have a script that lazy-loads images, but since chrome 76 there is a 'native' lazy load.

I'm trying to detect whether browser supports native lazy-load or not. But I have no idea how to do this.

I have a script that lazy-loads images, but since chrome 76 there is a 'native' lazy load.

I'm trying to detect whether browser supports native lazy-load or not. But I have no idea how to do this.

Share Improve this question edited Sep 21, 2019 at 19:32 JLRishe 102k19 gold badges137 silver badges171 bronze badges asked Sep 21, 2019 at 19:21 user10600676user10600676
Add a ment  | 

1 Answer 1

Reset to default 9

You can do this by using feature detection on an img element:

var supportsLazyLoad = ('loading' in document.createElement('img'));

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745108001a4611673.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信