Permalink
Browse files

Merge pull request #26 from glensc/no-globals

fix leaking variables to global scope
  • Loading branch information...
2 parents 3eba280 + 60b551f commit f160ab33b7b224397839bf1e742d467f72121009 @krewenki committed Aug 9, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 jquery.lightbox.js
View
5 jquery.lightbox.js
@@ -195,7 +195,7 @@
};
function doChangeImage() {
- imgPreloader = new Image();
+ var imgPreloader = new Image();
// once image is preloaded, resize image container
imgPreloader.onload = function() {
@@ -246,6 +246,7 @@
};
function preloadNeighborImages() {
+ var preloadPrevImage, preloadNextImage;
if (opts.loopImages && opts.imageArray.length > 1) {
preloadNextImage = new Image();
preloadNextImage.src = opts.imageArray[(opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1][0];
@@ -494,4 +495,4 @@
jsonData: null,
jsonDataParser: null
};
-})(jQuery);
+})(jQuery);

0 comments on commit f160ab3

Please sign in to comment.