Adding a lightbox plug-in for jQuery
Video: Adding a lightbox plug-in for jQueryAt this point, we are ready to add in a lightbox functionality. So the one I really like and I've included in the exercise files is Fancybox. To learn more about Fancybox, you can visit their web site, fancybox.net. You can download the latest copy of this particular plug-in, and this works exactly the same way as the preload works, where we hook in our files and then we simply can make calls called Fancybox just like regular functions inside of jQuery. So I am going to take the Fancybox folder in the includes directory from Exercise Files and we are going to move this over into our project.
Viewers: in countries Watching now:
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
Adding a lightbox plug-in for jQuery
At this point, we are ready to add in a lightbox functionality. So the one I really like and I've included in the exercise files is Fancybox. To learn more about Fancybox, you can visit their web site, fancybox.net. You can download the latest copy of this particular plug-in, and this works exactly the same way as the preload works, where we hook in our files and then we simply can make calls called Fancybox just like regular functions inside of jQuery. So I am going to take the Fancybox folder in the includes directory from Exercise Files and we are going to move this over into our project.
Down here at the bottom, I will open this window up more. We are going to click on fancybox-1.3.4.js. Click Choose. Click OK. Let's hit another Return. Now we need to import a CSS file, come up to Format > CSS Styles > Attach Style Sheet, Browse > myGallery > includes > jquery.fancybox > fancybox folder, and we will grab the fancybox-1.3.4.css and click Choose and say OK.
Switch back out to Design view. I can now see the Fancybox, related files showing up here on the top of Dreamweaver as well. Now in the next movie, we're going to set up some jQuery statements to activate hyperlinks to load high-res images in the lightbox.
Find answers to the most frequently asked questions about Create an Interactive Photo Gallery with jQuery and Dreamweaver .
Here are the FAQs that matched your search "" :
- 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?
- 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.
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.
If you want to customize your gallery further, look at the list of the customizable properties at http://fancybox.net/api.
- 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:
- Update the HTML to HTML5
- Update the version of jQuery
- Use the Google html5shiv to keep compatibility with Internet Explorer 7 & 8
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.