sankam / yii2-fancybox
FancyBox3 Widget for Yii2 framework
Installs: 126
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/fancybox: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-02-01 22:08:41 UTC
README
Yii2 extension for fancyapps.com/fancybox
Installation
The preferred way to install this extension is through composer.
Either run
php composer require "sankam/yii2-fancybox" "*"
or add
"sankam/yii2-fancybox" : "*"
to the require section of your application's composer.json
file.
Usage
use sankam\fancybox\FancyBox;
FancyBox::widget([
'target' => '[data-fancybox]',
'options' => [
'loop' => false,
'padding' => 0,
'margin' => [44, 0],
'onInit' => new JsExpression("
function( instance ) {
instance.$refs.downloadButton = $('<a class=\"fancybox-button fancybox-download\"></a>')
.appendTo( instance.$refs.buttons );
}
"),
'beforeMove' => new JsExpression("
function( instance, current ) {
instance.$refs.downloadButton.attr('href', current.src);
}
"),
],
]);