Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix leaking variables to global scope

imgPreloader, preloadPrevImage and preloadNextImage leaked to global
scope
  • Loading branch information...
commit 60b551fbdb0f3c388c835ada30db729f3f37dd02 1 parent 3eba280
@glensc glensc authored
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);
Please sign in to comment.
Something went wrong with that request. Please try again.