eluhr/

yii2-swiper

Swiper 滑块组件的 Yii2 扩展

v3.0.1 2018-12-10 09:59 UTC

This package is auto-updated.

Last update: 2024-08-26 17:38:40 UTC


README

Yii2 适配的 Swiper 滑块小部件。更多信息请查看:https://github.com/nolimits4web/Swiper/

示例可以在 demos 文件夹中找到。

您还可以阅读 文档

安装

您可以通过 Composer 获取此扩展。

在终端中运行

$ php composer.phar require "romka-chev/yii2-swiper" "*"

或者在您的应用程序的 composer.json 文件的 require 部分添加以下内容:

"romka-chev/yii2-swiper" : "*"

to the require section of your application's composer.json file.

###使用方法

 
<?php
/**
 * @var \yii\web\View $this
 */
use romkaChev\yii2\swiper\Swiper;

echo Swiper::widget( [
  'items'         => [
    [ 'background' => 'http://lorempixel.com/600/600/nature/1' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/2' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/3' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/4' ],
    [ 'background' => 'http://lorempixel.com/600/600/nature/5' ]
  ],
  'behaviours'    => [
    'pagination'
  ],
  'pluginOptions' => [
    'grabCursor'     => true,
    'centeredSlides' => true,
    'slidesPerView'  => 'auto',
    'effect'         => 'coverflow',
    'coverflow'      => [
        'rotate'       => 50,
        'stretch'      => 0,
        'depth'        => 100,
        'modifier'     => 1,
        'slideShadows' => true
    ]
  ]
] );
 

问题

如果出现任何问题,您可以在 issue 中创建问题。

感谢您的关注。