drmabuse / yii2-slick-carousel
the last carousel you'll ever need
Installs: 10 405
Dependents: 1
Suggesters: 0
Security: 0
Stars: 6
Watchers: 5
Forks: 10
Type:yii2-extension
Requires
- bower-asset/slick-carousel: @stable
This package is not auto-updated.
Last update: 2024-12-21 16:31:03 UTC
README
the Preview http://kenwheeler.github.io/slick/
The yii2 widget to the fantastic slick-carousel. This widget generate you the only the javascript.
###Installation Composer drmabuse/yii2-slick-carousel:"*"
Installation Assets Bower
cd vendor/drmabuse/yii2-slick-carousel/web
bower install
###Using
\drmabuse\slick\SlickWidget::widget([
'container' => '.single-item',
'settings' => [
'slick' => [
'infinite' => true,
'slidesToShow' => 3,
'onBeforeChange'=> new \yii\web\JsExpression('function(){
}'),
'onAfterChange' => new \yii\web\JsExpression('function(){
console.debug(this);
}'),
'responsive' => [
[
'breakpoint'=> 768,
'settings'=> [
'arrows'=> false,
'centerMode'=> true,
'centerPadding'=> 40,
'slidesToShow'=> 3
]
]
],
],
'slickGoTo' => 3,
]
]);
<div class="slider single-item">
<div><h3>1</h3></div>
<div><h3>2</h3></div>
<div><h3>3</h3></div>
<div><h3>4</h3></div>
<div><h3>5</h3></div>
<div><h3>6</h3></div>
</div>