Closing img on background click not working in the plugin
-
Hey Leonardo,
i have worked a bit with your plugin and tested a function that i wanted to achieve: closing the lightbox on clicking outside the img.
In other plugins using the “siwpebox” this following functions works perfectly. This is the JS i am working with:// addition for swipebox, closing img on click on bg
jQuery(function(){
“use strict”;
jQuery(document.body)
// closes when bg clicked
.on(‘click touchend’,’#swipebox-slider .current img’, function(){
return false;
})
.on(‘click touchend’,’#swipebox-slider .current’, function(){
jQuery(‘#swipebox-close’).click();
});
});However in your plugin this code doesn′t seem to work. Do you have an idea how i can get this function to work? I′ve checked all IDs and CSS names and they are identical.
I have called the JS in the “jquery.swipebox.js” file and in the header – without any result.
Any help would be highly appreciated!
Thanks in advance for your help!
Justin
- The topic ‘Closing img on background click not working in the plugin’ is closed to new replies.