0

Is it possible to use the Lightbox2 script to display all photos from a given directory instead of listing each photo in the html?

This is really just a yes or no question, but please feel free to explain. I want to know if this is possible and if I should spend my time trying to figure it out. Thanks for the help.

Pat
  • 63
  • 7

1 Answers1

1

No, Lightbox2 is written in JavaScript.

When used on a webpage, JavaScript is a client-side scripting language. This means that the code executes on your web browser, and only has access to data the web browser makes available to it.

For more info: Client-side scripting

You need to use a server-side language (PHP, ASP.NET, etc.) to work with the server-side directories.

Here is an answer to a similar question, with a suggestion to create an index file w/ all the image file names that you could then parse with JavaScript. I don't think it would be much more efficient than manually adding img elements though.

Is there a way to return a list of all the image file names from a folder using only Javascript?

Community
  • 1
  • 1
Bob
  • 53
  • 3
  • Thank you for the answer. This site is for my in-laws to upload the artwork to a site I've developed. I'm trying to make it as user friendly as possible. – Pat Jul 28 '15 at 12:53