wokster / yii2-owl-carousel-widget

yii2 的 Owl carousel 插件

1.0.1 2017-09-22 19:47 UTC

This package is auto-updated.

Last update: 2024-08-29 04:48:42 UTC


README

yii2 的 Owl carousel 插件

基于 https://owlcarousel2.github.io

DEMO:https://owlcarousel2.github.io/OwlCarousel2/demos/demos.html

文档:https://owlcarousel2.github.io/OwlCarousel2/docs/started-welcome.html

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

php composer.phar require --prefer-dist wokster/yii2-owl-carousel-widget "*"

"wokster/yii2-owl-carousel-widget": "*"

将以下内容添加到您的 composer.json 文件中的 require 部分。

用法

扩展安装完成后,只需在代码中通过以下方式使用它:

        <?php \wokster\owlcarousel\OwlWidget::begin([
            'theme'=>'green', //can be "green","default", false (false by default)
            'plaginOptions'=>[
                'loop' => true,
                'margin' => 10,
                'responsiveClass' => true,
                'responsive' => [
                  0 => ['items'=>1,'nav'=>true],
                  600 => ['items'=>3,'nav'=>true],
                  1000 => ['items'=>5,'nav'=>true],
                ],
            ]
        ]);?>
              <div> Your Content </div>
              <div> Your Content </div>
              <div> Your Content </div>
              <div> Your Content </div>
              <div> Your Content </div>
              <div> Your Content </div>
              <div> Your Content </div>
        <?php \wokster\owlcarousel\OwlWidget::end()?>