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 user10600676user106006761 Answer
Reset to default 9You 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条)