Join Chris Converse for an in-depth discussion in this video Changing the preview when clicking thumbnails, part of Create an Interactive Photo Gallery with jQuery and Dreamweaver.
So, whichever anchor link we actually clicked on, we are going to pull into a…new variable called photo_caption the title attribute of that object. That's…going to give us our caption.…var photo_fullsize.…It's going to be equal Dollar sign this .attr, and in here we are going to put href,…the actual link destination of full size, because we took the thumbnail images…and actually linked them to the high-resolution full-size image.…
That's where that variable is going to set up.…Then lastly, photo_preview.…Now, photo_preview would never use the term preview.jpg. So right now in our…
Download a copy of the finished web site here.
- Preparing gallery photos using Adobe Bridge
- Adding and linking thumbnail images
- Creating the layout in HTML and CSS
- Downloading and adding jQuery to the project
- Creating preview images from anchor links
- Implementing the preload functionality
- Building a customized lightbox with the Fancybox plug-in
- Styling the zoom and contact links
Skill Level Intermediate
Q: The finished state of the interactive photo gallery in this course shows a clickable preview. When you click on the preview image, or on the view larger icon, a larger lightbox image appears. Chris's example has a close button and border surronding the large image, but mine doesn't. Did I miss a step?
<div>A: The functionality you describe is part of FancyBox plug-in we use in this course. It's a custom lightbox tool, which I've included in the exercise files and also available for download at fancybox.net. It's free and highly customizable.<br /> </div> <div> </div> <div>By default, FancyBox adds a border to images (at least in the version of FancyBox we're using), but there are many options that can be turned on when you set up your fancybox initialization script, including the close button, which is invoked using the showCloseButton property. This is all covered in the "Creating a custom function for lightbox properties" movie.<br /> </div> <div> </div> <div>If you want to customize your gallery further, look at the list of the customizable properties at http://fancybox.net/api.<br /> </div>
Q: This course was updated in April, 2013. What changed?
A: Since the release of this course, Internet Explorer 9 and 10 have been released, and sometimes these browsers do not activate interactive HTML content. To remedy this problem, the author has added a movie to Chapter 10 that will show you how to:<br />- Update the HTML to HTML5<br />- Update the version of jQuery<br />- Use the Google html5shiv to keep compatibility with Internet Explorer 7 & 8