O'Reilly logo

Instant Fancybox by Kyle Diedrick

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

Creating an image gallery (Simple)

Fancybox also provides some great image gallery and slideshow functionality. Let's take a look at what is involved in creating a Fancybox gallery.

Getting ready

Before we get started, we need to find a handful of images that we can use for the gallery. Find four to five images to use for the gallery and put them in the images folder.

How to do it...

  1. Add the following links to the images to the index.html file:
    <a class="fancybox" 
      href="images/waterfall.png">Waterfall</a>
    <a class="fancybox" href="images/frozen-
      lake.png">Frozen Lake</a>
    <a class="fancybox" href="images/road-in-
      forest.png">Road in Forest</a>
    <a class="fancybox" href="images/boston.png">Boston</a>
    

    Note

    The anchor tags no longer have an ID, but a class. ...

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