flashLightBoxInjector 1.2 and Lightbox 2.0.4

bridgedGap2It has been brought to my attention that the release of Lightbox 2.0.4 broke some stuff in flashLightBoxInjector 1.2. After investigating the issue, it turns out that one (1) tiny change to the lightbox.js file is needed in order to get flashLightBoxInjector working with Lightbox 2.0.4.

In Lightbox 2.0.4 Lokesh (the author of Lightbox) decided to create the Lightbox instance without storing it into a variable. As flashLightBoxInjector relies on that variable, things broke. Now, to fix this follow this tiny procedure and it’ll work just fine, as it did with version 2.0.3:

  1. Open lightbox.js with your favorite texteditor
  2. Scroll down to the very last line where it reads
    document.observe('dom:loaded', function () { new Lightbox(); });
  3. Replace that line with this
    document.observe('dom:loaded', function () { myLightbox = new Lightbox(); });
  4. Save your file and … that’s it :)

I’ve changed the online example and flashLightBoxInjector 1.2 download and demos here on bram.us to include that change, so you can roll with it “out of the box”. Above that I’ve mailed Lokesh about this issue, hoping to see the variable reappear in a next release.

JS_BRAMUS, Projects, Webdevelopment

3 Responses to flashLightBoxInjector 1.2 and Lightbox 2.0.4

  1. Pingback: Bram.us » My Code Snippet : Automatically start Lightbox on page load (autoFireLightbox)

  2. MyLightBox Error says:

    There is no need to change lightbox.js.I just change mylightbox to lightbox and fixed problem

  3. Paul says:

    Good man – knew someone would have solved it. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>