I asked the author this but he said for me to add the contributions I want via Github, and I don't know how to do that as I'm not that knowledgeable with JavaScript. Hope you all can help. :)
Here's the link to the plugin: http://brutaldesign.github.io/swipebox/
Basically, how could I make the lightbox close by clicking anywhere outside the image? Like how most lightboxes function?
This lightbox does it perfectly how I want it: http://fancyapps.com/fancybox/ I dont use that lightbox because it doesn't have the swipe functionality that I need.
I do know it has to be something to do with the following function
.click
Thanks in advance!
(updated with more events and better event delegation)
Try adding the following script to your page
<script>
$(function(){
$(document.body)
.on('click touchend','#swipebox-slider .current img', function(e){
return false;
})
.on('click touchend','#swipebox-slider .current', function(e){
$('#swipebox-close').trigger('click');
});
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With