Lightweight webpage image attribution Javascript library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


gally.js is a lightweight gallery management Javascript library, deployable as a means of attributing images dynamically entirely through client-side code.

Code Example

gally.js will target and hyperlink HTML elements specified by their id and set said element’s text and href to appropriate attribution information as provided. Gally.js is client-side and is dependant on the file hierarchy information it is provided and requires numerical image file organization. For example:

│   │
│   ├───/hermes/
│   │       1.jpg
│   │       2.jpg
│   │       3.jpg
│   │
│   ├───/hubert/
│   │       1.jpg
│   │       2.jpg
|   |

By including the following in a .html file body:

Background photo by: <a id="credit" class="active" href="#" >None</a>
<script type="text/javascript">
    addAuthour("hermes", 3, "http://hermes.example", "Hermes Conrad");
    addAuthour("hubert", 2, "http://hubert.example", "Hubert Farnsworth");

The webpage will choose an available image at random, set the image as the page background, and set the innerHTML and href of the hyperlink “credit” to the correct attribution name and website of the displayed image.


This project began as a one-time solution to dynamic landing page image attribution for randomly selected background images on acorn30 subsidiary side Neighbourhood Domains. It was since expanded into a deployable Javascript library which can be freely and easily modified to support a variety of small-scale gallery applications entirely through client side code.


Simply obtain the gally.js file from this GitHub repository and add it the appropriate Javascript containing folder on your site, or deploy directly via RawGit.

API Reference

View the documentation here.


A detailed series of examples are available on the acorn30labs blog post for gally.js.


Contributions welcome! Though initially developed entirely by Elisha Sarkis at acorn30 internally, gally.js is an MIT lisence free and open source project as of this repository’s initialization.