O'Reilly logo

Instant Galleria How-to by Nathan Van Gheem

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the API (Medium)

Learn how to use the Galleria API to hook into events and use different API calls by creating a customized gallery that utilizes them.

Getting ready

For this exercise, we'll be going through an example that utilizes an event listener and API calls. To start us off, create an api-example.html file in the development folder.

How to do it...

  1. To keep our HTML as small as possible, we'll use the flickr plugin. That way we don't have to reference any local images as shown in the following code:
    <!DOCTYPE html> <html lang="en"> <head> <script src="http://code.jquery.com/jquery.min.js"></script> <script src="../galleria-1.2.8.min.js"></script> <script src="../plugins/flickr/galleria.flickr.min.js"> </script> <script type="text/javascript"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required