IE10 returns undefined for naturalWidth until the image supplied in the src has loaded, rather than the 0 defined in the spec. The 'naturalWidth' in (new Image) gets around this.
It also adds a width and height to the lazy loaded images, that the this.gif.removeAttribute fix further up doesn't fix. I've removed the attributes again once the image has had its src swapped and this fixes the issue.
Lazy Loading now works in IE10.
p.s. Thanks for the script, it's been pretty useful!
IE10 returns undefined for naturalWidth until the image supplied in the src has loaded, rather than the 0 defined in the spec. The 'naturalWidth' in (new Image) gets around this.
It also adds a width and height to the lazy loaded images, that the this.gif.removeAttribute fix further up doesn't fix. I've removed the attributes again once the image has had its src swapped and this fixes the issue.
Lazy Loading now works in IE10.
p.s. Thanks for the script, it's been pretty useful!