Closing lightbox image with click on the image instead of the 'x' button

Hi,

is it possible to close the lightbox image with a click on the image instead of the 'x' button?

kind regards

Comments

  • Hi,
    sorry but there is no possibility to do that. You would have to either click the X or outside the image field.
    thanks
  • I edited \wp-content\themes\betheme\js\scripts.js and in every call to init magnificPopup I added the option closeOnContentClick : true - and that allows to close lightbox images with a click on the image.
    $( 'a[rel^="lightbox"][data-type="image"]' ).magnificPopup({
    autoFocusLast : attr.autoFocusLast,
    removalDelay : attr.removalDelay,
    closeOnContentClick : true,
    type : 'image',
    image : attr.image
    });
  • Thanks for the reply! I added the code at the beginning of scripts.js but sadly it doen't work... 
Sign In or Register to comment.