? mpb-lightbox2.patch Index: lightbox.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/lightbox2/js/lightbox.js,v retrieving revision 1.5.2.6.2.120 diff -u -r1.5.2.6.2.120 lightbox.js --- lightbox.js 13 Sep 2009 23:27:32 -0000 1.5.2.6.2.120 +++ lightbox.js 12 Oct 2009 22:10:48 -0000 @@ -632,11 +632,13 @@ $(src).appendTo("#modalContainer"); } else { - $("#modalContainer").load(src); + // Use a callback to show the new image, otherwise you get flicker. + $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();}); } $('#modalContainer').unbind('click'); } - $('#modalContainer').css({'zIndex': '10500'}).show(); + // This might be needed in the Lightframe section above. + //$('#modalContainer').css({'zIndex': '10500'}).show(); } } @@ -782,7 +784,9 @@ // If not first image in set, display prev image button. if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) { - $(prevLink).css({'zIndex': '10500'}).show().click(function() { + // Unbind any other click handlers, otherwise this adds a new click handler + // each time the arrow is clicked. + $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; }); } @@ -793,7 +797,9 @@ // If not last image in set, display next image button. if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) { - $(nextLink).css({'zIndex': '10500'}).show().click(function() { + // Unbind any other click handlers, otherwise this adds a new click handler + // each time the arrow is clicked. + $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; }); }