.bind( type, callback )

returns Galleria

Binds a callback function to a Galleria event. The callback function contains the event object as the only argument. Example:

this.bind('image', function(e) {
    Galleria.log(this) // the galleria instance
    Galleria.log(e.imageTarget); // the displayed Image element

this.bind('fullscreen_enter', function(e) {
    Galleria.log('Fullscreen mode!');

.unbind( type )

returns Galleria

Removes all functions attached to a Galleria event.

.trigger( type )

returns Galleria

Manually triggers a Galleria event.

.lazyLoad( array, complete )

returns Galleria

If you set thumbnails: lazy you can use this method to lazyLoad thumbnails at any time. Just pass an array of indexes to make the gallery load the thumbnails. Example:

this.lazyLoad( [0,1], function() {
    Galleria.log('Thumbnails 0 and 1 are loaded');

.lazyLoadChunks( size, delay ) -----------------

returns Galleria

If you set thumbnails: lazy you can use this method to set up Galleria to lazy load all thumbnails in chunks. F.ex if you have 30 images, and want to load the first 10 thumbnails first, then the next 10 and so on, you can do:

this.lazyLoadChunks( 10 );

delay is an optional parameter that adds a delay in milliseconds between the loads.


returns Galleria

Wipes out the galleria gallery and restores the original content.

.attachKeyboard( map )

returns Galleria

This helper method attaches keyboard events to Galleria. The map object contains a map of functions to execute when a certain keyCode is pressed.

You can use a number of helper keywords to identify common keys. The keywords are up, down, left, right, return, escape and backspace.

If you call this method again with the same key, you will simply override the last function. Example attaching some keyboard action to galleria:

    left: this.prev, // applies the native prev() function
    right: this.next,
    up: function() {
        // custom up action
        Galleria.log('up pressed');
    13: function() {
        // start playing when return (keyCode 13) is pressed:

    left: this.openLightbox // will override the previously defined prev()


returns Galleria

Removes all keyboard events attached using .attachKeyboard(). Useful when building lightboxes or overlays.