lokesh / lightbox2

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

Make it a real jquery plugin #502

Closed greggman closed 8 years ago

greggman commented 8 years ago

Unless I'm getting confused the original light box was a normal jquery plugin. That meant I called when I wanted to with the list of images. That was far more flexible because it meant I got to decide how to find which images. Maybe I do an ajax request to flickr to get a list of images. Maybe I search for images with "-small.*". A simple jquery $(someSelector) let me pick. Here' you've hardcoded the selector.

Unless I understand correctly now it's automatic. The moment lightroom loads it looks for its hardcoded attributes. There's no chance to pick your own criteria unless you do some kind of sync/async load of other scripts to apply that attribute.

Just a suggestion but it would be far more useful if you could pass in your own image list.

lokesh commented 8 years ago

You are correct that the current version of Lightbox (v2.x) does the initialization automatically on loading the script. I'm planning out v3.0 now and it will give developers much more control about how and when the script is initialized. It is unlikely to be a jQuery plugin as I am exploring removing the jQuery dependency altogether.

Your feedback has been noted in the README.md's v3.0 brainstorming section. Thanks!