Skip to content

Commit 8ff1a2b

Browse files
committed
Merge pull request buckwilson#29 from entp/master
Fix: multiple close events being triggered
2 parents 186abc8 + c812fd5 commit 8ff1a2b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jquery.lightbox_me.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@
9292

9393
$(window).resize(setOverlayHeight)
9494
.resize(setSelfPosition)
95-
.scroll(setSelfPosition)
96-
.keyup(observeKeyPress);
95+
.scroll(setSelfPosition);
96+
97+
$(window).bind('keyup.lightbox_me', observeKeyPress);
98+
9799
if (opts.closeClick) {
98100
$overlay.click(function(e) { closeLightbox(); e.preventDefault; });
99101
}
@@ -135,7 +137,7 @@
135137
$(window).unbind('reposition', setOverlayHeight);
136138
$(window).unbind('reposition', setSelfPosition);
137139
$(window).unbind('scroll', setSelfPosition);
138-
$(document).unbind('keyup', observeKeyPress);
140+
$(window).unbind('keyup.lightbox_me');
139141
if (ie6)
140142
s.removeExpression('top');
141143
opts.onClose();

0 commit comments

Comments
 (0)