(+84) 463.28.7979

jQuery “FancyBox”


FancyBox is a tool for displaying images, HTML content and multi-media in a Mac-style “lightbox” that floats overtop of web page.

JavaScript

We should include jQuery framework, jquery.fancybox-1.3.1.pack and jquery.easing-1.3.pack by pointing src attribute in the script tag to those .js files.

1

Initialization script we place in the <head> section. It initializes the link with the id #single_image
2
There are plenty of additional settings, that you can check at the official website http://fancybox.net/api

HTML

Below you can see general HTML script representation:
3

The href attribute indicates path to big image, which will display in the preview window. If you need to arrange some number of images into one gallery, then add attribute rel with the same value (id) (e.g. rel=”group1″).

CSS

You can find script related styles in the css file:
4

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>