jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable. http://fancyapps.com/fancybox/3/, (*1)
Installation
The minimum required PHP version is PHP 5.6 (Concatenation).
It works best with PHP 7.
The preferred way to install this extension is through composer., (*2)
to the require section of your composer.json file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
<?php
echo newerton\fancybox3\FancyBox::widget();
Options
'[data-fancybox]',
'config' => [
// Enable infinite gallery navigation
'loop' => true,
// Space around image, ignored if zoomed-in or viewport smaller than 800px
'margin' => [44,0],
// Horizontal space between slides
'gutter' => 30,
// Enable keyboard navigation
'keyboard' => true,
// Should display navigation arrows at the screen edges
'arrows' => true,
// Should display infobar (counter and arrows at the top)
'infobar' => true,
// Should display toolbar (buttons at the top)
'toolbar' => true,
// What buttons should appear in the top right corner.
// Buttons will be created using templates from `btnTpl` option
// and they will be placed into toolbar (class="fancybox-toolbar"` element)
'buttons' => [
'slideShow',
'fullScreen',
'thumbs',
'close'
],
// Detect "idle" time in seconds
'idleTime' => 4,
// Should display buttons at top right corner of the content
// If 'auto' - they will be created for content having type 'html', 'inline' or 'ajax'
// Use template from `btnTpl.smallBtn` for customization
'smallBtn' => 'auto',
// Disable right-click and use simple image protection for images
'protect' => false,
// Shortcut to make content "modal" - disable keyboard navigtion, hide buttons, etc
'modal' => false,
'image' => [
// Wait for images to load before displaying
// Requires predefined image dimensions
// If 'auto' - will zoom in thumbnail if 'width' and 'height' attributes are found
'preload' => "auto",
],
'ajax' => [
// Object containing settings for ajax request
'settings' => [
// This helps to indicate that request comes from the modal
// Feel free to change naming
'data' => [
'fancybox' => true
]
]
],
'iframe' => [
// Iframe template
'tpl' => '',
// Preload iframe before displaying it
// This allows to calculate iframe content width and height
// (note: Due to "Same Origin Policy", you can't get cross domain data). 'preload' => true,
// Custom CSS styling for iframe wrapping element
'css' => [],
// Iframe tag attributes
'attr' => [
'scrolling' => 'auto'
]
],
// Open/close animation type
// Possible values:
// false - disable
// "zoom" - zoom images from/to thumbnail
// "fade"
// "zoom-in-out"
//
'animationEffect' => "zoom",
// Duration in ms for open/close animation
'animationDuration' => 366,
// Should image change opacity while zooming
// If opacity is 'auto', then opacity will be changed if image and thumbnail have different aspect ratios
'zoomOpacity' => 'auto',
// Transition effect between slides
//
// Possible values:
// false - disable
// "fade'
// "slide'
// "circular'
// "tube'
// "zoom-in-out'
// "rotate'
//
'transitionEffect' => "fade",
// Duration in ms for transition animation
'transitionDuration' => 366,
// Custom CSS class for slide element
'slideClass' => '',
// Custom CSS class for layout
'baseClass' => '',
// Base template for layout
'baseTpl' => '