speedplli/

yii2-swiper

Yii2 扩展用于 Swiper 滑块

2.0.4 2018-10-11 07:43 UTC

This package is auto-updated.

Last update: 2024-09-09 05:10:35 UTC


README

Swiper 滑块的小部件。更多详情请见:https://github.com/nolimits4web/Swiper/.

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

您还可以阅读 文档

安装

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

在终端中运行

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

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

"lantongxue/yii2-swiper" : "*"

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

###用法

 
<?php
/**
 * @var \yii\web\View $this
 */
use speedplli\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
    ]
  ]
] );
 

问题

如果出现问题,您可以创建 问题

感谢您的关注。