When I click with mouse left or right near opened jlightbox window nothing do. In original lightbox when I click near lightbox image window, lightbox window have been closed. It's working when I click up or bottom. Its bug or feature? thank you for great module.

CommentFileSizeAuthor
#1 jlightbox_327139_clickclose.patch878 bytesdboulet

Comments

dboulet’s picture

Status: Active » Needs review
StatusFileSize
new878 bytes

I would consider this a bug. Here's a patch to the uncompressed javascript that fixes the problem. Now clicking anywhere on the background closes the lightbox window. This would have to get recompressed into jlightbox.js to work.

dboulet’s picture

Title: Click near jlightbox not working » Close lightbox when background overlay is clicked
Component: Code » JavaScript

Any word on getting this committed?

sun’s picture

I need some positive confirmations for IE6, IE7, Chrome, Safari, and Firefox first.

dboulet’s picture

I tested the uncompressed JavaScript, works for me in the following browsers:

Windows XP

  • Firefox 3.0.6
  • Opera 9.64
  • Chrome 1.0.154.48
  • Safari 3.2.2
  • IE 7.0.573.11
  • IE 6

Mac OSX

  • Firefox 3.0.7
  • Safari 3.2.1
sun’s picture

Status: Needs review » Fixed

Committed to all branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kalidasan’s picture

I was trying to close lightbox, when we click on background overlay(Grey background).
But #lightbox content was overlapped #lightbox2-overlay.
So not able to write click event for #lightbox2-overlay.

Note:
I dont want to use "Click on overlay or lightbox to close it" option available in backend.
Because we want click event only for overlay.

Finally achieved using jQuery event.target.id

 $('#lightbox2-overlay, #lightbox').click(function(e) {
      e.preventDefault();
      var target_id = e.target.id;
      if (target_id == 'lightbox2-overlay' || target_id == 'lightbox') {
        Lightbox.end(); return false;
      }
    });

use above code in your custom JS.