lokesh / lightbox2

THE original Lightbox script (v2).
http://lokeshdhakar.com/projects/lightbox2/
MIT License
6.22k stars 1.77k forks source link

Feature request to sandbox Lightbox events in a separate namespace #523

Open flacle opened 8 years ago

flacle commented 8 years ago

Hi!

I would like to request a feature that also seems to be a recommended practice by the jQuery API for registering event handlers with the on() function of jQuery.

For complex websites it is not always possible to easily disable Lightbox on a particular page (for instance, in cases where a frontend designer that cannot change the javascript execution order or prevent some plugins to be loaded). One way to disable Lightbox on a particular page is to unbind the registered click event on $('body') but as the jQuery API documentation specifies, this would also unbind other handlers attached to the same event type, adding a namespace to the Lightbox plugin would prevent that.

I'm including a link to my original issue posted on SO: http://stackoverflow.com/a/36471215/861597