FancyBox
FancyBox offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages.
FancyBox documentationHow to use?
Copy-paste the stylesheet <link>
into your <head>
to load the CSS.
Copy-paste the following <script>
near the end of your pages under JS Implementing Plugins to enable it.
Copy-paste the following <script>
near the end of your pages under JS Front to enable it.
Copy-paste the init function under JS Plugins Init., before the closing </body>
tag, to enable it.
Gallery
Galleries are created from elements which have the same ID and class "selector": "#fancyboxGallery1 .js-fancybox",
attribute value.
Enable infinity slideshow with "loop": true
helper.
There is a built-in "overlayBg": "rgba(color, .opacityValue)"
helper. Set your custom option.
Or you can apply "overlayBlurBg": true
helper.
Also control the the popup opening, autoplay and the slideshow speed with "slideShow": {
"autoStart": true,
"speed": 5000
}
helpers.
Fancybox types
Script uses the "src": ""
attribute of the matched elements to obtain the location of the content and to figure out content type you want to display.
Methods
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-hs-fancybox-options='{}'
. For more detailed or missing attributes/functions, see the official FancyBox documentation page.
Parameters | Description |
---|---|
|
Reveal effect |
|
Hide effect |
|
Overlay color |
|
if true , then turns on the background blur effect |