Skip to content
This repository
Browse code

Save and call any existing window.onload handler

  • Loading branch information...
commit cd4c2b180f880e5869185a94399d5d88734d0413 1 parent 7b89bff
Jeff Lupien authored

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. +2 0  src/retina.js
2  src/retina.js
@@ -72,12 +72,14 @@
72 72
73 73
74 74 if (root.devicePixelRatio > 1) {
  75 + var existing_onload = window.onload || new Function;
75 76 window.onload = function() {
76 77 var images = document.getElementsByTagName("img"), retinaImages = [], i, image;
77 78 for (i = 0; i < images.length; i++) {
78 79 image = images[i];
79 80 retinaImages.push(new RetinaImage(image));
80 81 }
  82 + existing_onload();
81 83 }
82 84 }
83 85

0 comments on commit cd4c2b1

Please sign in to comment.
Something went wrong with that request. Please try again.