Boomerang uses Fancybox 3, a jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.
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).
You can install fancyBox by linking .css and .js to your html file. Make sure you also load the jQuery library. Below is a basic HTML template to use as an example:
The most basic way to use fancyBox is by adding the data-fancybox
attribute to a link.
A caption can be added using the data-caption
attribute.
<a href="PATH_TO_LARGE_IMAGE" data-fancybox="gallery" data-caption="My caption">
<img src="PATH_TO_THUMB" class="img-fluid rounded">
</a>
If you have a group of items, you can use the same attribute data-fancybox
value for each of them to create a gallery.
Each group should have a unique value.
<a href="PATH_TO_LARGE_IMAGE" data-fancybox="gallery" data-caption="My caption">
<img src="PATH_TO_THUMB" class="img-fluid rounded">
</a>
For inline content, create a hidden element with unique id.
And then simply create a link having data-src
attribute that matches ID of the element you want to open (preceded by a hash mark (#); in this example - #hidden-content):
<!-- Hidden content -->
<div class="d-none" id="fancybox_hidden_content">
<h2>Hello</h2>
<p>You are awesome.</p>
</div>
<!-- The button that will retrieve the content from the hidden div -->
<a data-fancybox data-src="#fancybox_hidden_content" class="btn btn-base-1" href="javascript:;">
Trigger the Fancybox
</a>
To load content via AJAX, you need to add a data-type="ajax"
attribute to your link.
And then simply create a link having data-src
attribute that matches ID of the element you want to open (preceded by a hash mark (#); in this example - #hidden-content):
Additionally it is possible to define a selector with the data-filter
attribute to show only a part of the response. The selector can be any string, that is a valid jQuery selector:
If the content can be shown on a page, and placement in an iframe is not blocked by script or security configuration of that page, it can be presented in a fancyBox.
Webpage Sample PDF
<a data-fancybox data-type="iframe" data-src="http://codepen.io/fancyapps/full/jyEGGG/" href="javascript:;">
Webpage
</a>
<a data-fancybox data-type="iframe" data-src="https://mozilla.github.io/pdf.js/web/viewer.html" href="javascript:;">
Sample PDF
</a>
Supported sites can be used with fancyBox by just providing the page URL.
YouTube video Vimeo video Google Map Instagram photo
<a data-fancybox href="https://www.youtube.com/watch?v=_sI_Ps7JSEk">
YouTube video
</a>
<a data-fancybox href="https://vimeo.com/191947042">
Vimeo video
</a>
<a data-fancybox href="https://www.google.com/maps/search/Empire+State+Building/">
Google Map
</a>
<a data-fancybox href="https://www.instagram.com/p/BNXYW8-goPI/?taken-by=jamesrelfdyer" data-caption="<span title="Edited">balloon rides at dawn ✨🎈<br>was such a magical experience floating over napa valley as the golden light hit the hills.<br><a href="https://www.instagram.com/jamesrelfdyer/">@jamesrelfdyer</a></span>">
Instagram photo
</a>