buckwilson / Lightbox_me

An easy to use lightbox plugin for jQuery
http://buckwilson.me/lightboxme
Other
433 stars 93 forks source link

Double-clicking a link breaks things. #43

Open ertyseidohl opened 12 years ago

ertyseidohl commented 12 years ago

I've found that quickly double-clicking (i.e., clicking again after the lightbox has started to load) removes the background but not the lightbox itself.

Here is the code I'm using to show the lightboxes:

$('document').ready(function(){
    $('.lightbox_link').click(function(e){
        $('#' + $(this).attr('href')).lightbox_me();
        e.preventDefault();
    });
});

And here is the link:

<a id="admin" class="lightbox_link" href="lightbox_admin">Ask an Admin for Data</a>

I have a feeling that just making sure that the click-to-close listener on the background div isn't set until the lightbox is generated will fix this, but I'm not set up to do the fix myself right now.

Please message me if you need more details - I hope this helps, and thanks for doing Lightbox_me - it's super awesome!

ertyseidohl commented 12 years ago

I've fixed this issue for myself by setting destroyOnClose to true, but the default settings are still annoying.