buckwilson/Lightbox_me

Setting closeClick to false is not working

Opened this issue · 2 comments

I wrote a very simple test and I can't seem to get closeClick to work. I'm not sure if it's a bug or if I'm not doing something properly, but this code works the same in the latest release versions of Safari, Chrome, and Firefox—that is, the lightbox closes when you click the overlay despite the option being set to false.

<head>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery.lightbox_me.js"></script>
<script type="text/javascript">
var $test = $('<div style="height: 200px; width: 300px; background-color: white;">');
$test.text("This is a test");
$test.lightbox_me({
        closeEsc:false,
        closeClick:false
      });
</script>
</body>
</html>

Of course, I included the lightbox_me file in the same directory.

I just noticed this problem. Looks like an old bug that came back in.

I fixed my sourcefile by adding if (opts.closeClick) to line 97 like this:-

if (opts.closeClick) $overlay.click(function(e) { closeLightbox(); e.preventDefault; });

Hope that helps until the boys refix this.

Great plugin Buck, thanks a million.

I did the same things and submitted a pull request to that effect. Use it if you like.

Definitely a great plugin.