Permalink
Browse files

Save and call any existing window.onload handler

  • Loading branch information...
1 parent 7b89bff commit cd4c2b180f880e5869185a94399d5d88734d0413 Jeff Lupien committed Sep 6, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/retina.js
View
2 src/retina.js
@@ -72,12 +72,14 @@
if (root.devicePixelRatio > 1) {
+ var existing_onload = window.onload || new Function;
window.onload = function() {
var images = document.getElementsByTagName("img"), retinaImages = [], i, image;
for (i = 0; i < images.length; i++) {
image = images[i];
retinaImages.push(new RetinaImage(image));
}
+ existing_onload();
}
}

0 comments on commit cd4c2b1

Please sign in to comment.