Skip to content

Commit 07cc06a

Browse files
author
gijsroge
committed
Use a different method to reset the image regardless cache in Webkit.
1 parent 44d8e25 commit 07cc06a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ export default function (elem, opts) {
3434
}
3535

3636
forEach(elem, el => {
37-
const img = new Image();
38-
img.src = el.src;
39-
img.onload = onload;
40-
img.onerror = onerror;
37+
const src = el.src;
38+
el.src = '';
39+
el.src = src;
40+
el.onload = onload;
41+
el.onerror = onerror;
4142
});
4243
}

0 commit comments

Comments
 (0)