jQuery lightbox script for displaying images, videos and more.
Touch enabled, responsive and fully customizable.


Quick start

<!-- 1. Add latest jQuery and fancyBox files -->

<script src="//"></script>

<link rel="stylesheet" href="" />
<script src=""></script>

<!-- 2. Create links -->

<a data-fancybox="gallery" href="big_1.jpg"><img src="small_1.jpg"></a>
<a data-fancybox="gallery" href="big_2.jpg"><img src="small_2.jpg"></a>

<!-- 3. Have fun! -->

See the documentation

Why fancyBox

Mobile first

Looks great on every device.
Supports most common touch gestures - double-tap, pinch-in and pinch-out for image viewing; horizontal swipe for navigation.

Multiple instances

It is possible to open a modal while another is still visible.

Quick & Easy Setup

Just two files. Can be implemented without writing a single line of JavaScript.

Automatic content recognition

Supports most popular sites as YouTube, Vimeo and Google maps out of the box.

GPU accelerated

Hardware accelerated animations for better performance.


Set content dimensions using any CSS unit and the browser will do the rest.
All graphics, including loading icon, are created with CSS only.


Image gallery

By default, fancyBox fully preloads an image before displaying it. You can choose to display the image right away. It will render and show the full size image while the data is being received.

fancyBox supports srcset with the w descriptor across all browsers. This allows to serve different scaled images based on viewport width. What this means is that mobile users can now be served smaller file sizes, which in turn speeds up the delivery of the content. Also over time this can save quite a bit of bandwidth, which in turn can save you money.

Supported sites can be used with fancyBox by just providing the page URL. You can mix images, videos and any HTML content in each gallery.

Be creative

The goal of fancyBox3 is to help you stand out and save you time. With the help of a bit of CSS and JS, you can easily create something awesome. Different animations, UI, anything is possible! 😉

Below is just a small assortment of creative demos.

Customized layout

Change visuals and even the layout just using CSS. Change position of caption and use it for displaying social icons or advertisment.

Confirm dialog

You can create a more modern look for alert and confirm dialogs using fancyBox.

Quick product view

Completely change the look and feel of the modal window. Custom layout, design and dotted navigation.

Morphing modal overlay

Combination of jQuery, CSS transitions to spice up the way modal window opens.


fancyBox is licensed under the GPLv3 license for all open source applications.
A commercial license is required for all commercial applications (including sites, themes and apps you plan to sell).

Commercial license

Limited to 1 project
Community support
Future updates

Commercial license

Unlimited projects
1 year premium support
Future updates

Safe and Secure payments are processed by FastSpring.

I already have a fancyBox 2 license. Do I need to upgrade it?

No. All licenses purchased before February 24st 2017 have been automatically upgraded to their current equivalent and no action is required by the license holder.

What is the main difference between Single and Extended license?

The main purpose of Extended license is to allow you to build websites for your clients without purchasing a new license for each project.

Can I use fancybox in product sold for multiple clients (for example, in theme sold on Themeforest)?

By purchasing ONE "Extended Commercial license", you are allowed to include fancyBox in ONE product (for example: premium theme, plugin or template) for sale. Customers and users of your product do not need to purchase their own license — as long as they are not developing their own commercial products with fancyBox.

You are not allowed to create a product directly competing with fancyBox. For example, you are not allowed to create a premium plugin whose main purpose is to bring modal/lightbox functionality to website.