javascripthtmllightbox2

Is there a way to change the lb-number output to a different version


I'm currently in the process of creating an about-us page, with a small gallery using lightbox2.

The language of the page will not be English, and due to design consistency and customer demand I'd like to change the printed "Image x of y" in the "lb-dataContainer/lb-data/lb-number"

Since it's a span created by the js I suppose my answer will be, of course, in there.

PS: I'd like to change the "Image x of y" format to an "Image x / y" format as well.

I'm very early into my web-dev career so please excuse any misunderstandings on my part.

Thanks for your time!


Solution

  • The answer to this and many other questions about lighbox could be found on the examples page of the lightbox: https://lokeshdhakar.com/projects/lightbox2/#examples

    It says that you can use the option albumLabel to change the label - like this:

    lightbox.option({
      albumLabel: "Image %1 / %2"
    });