为yii的jQuery sly图片滑动扩展

安装次数: 1,050

依赖者: 0

推荐者: 0

安全: 0

星标: 3

关注者: 2

分支: 0

开放问题: 0

语言:JavaScript

类型:yii2-extension

1.0.0 2014-09-26 09:22 UTC

This package is not auto-updated.

Last update: 2024-09-10 05:29:45 UTC


README

此扩展是用于惊人的jQuery滑动插件"sly"的包装,可以在以下链接找到

http://darsa.in/sly/

请仔细查看所有插件选项,这些选项可以通过将它们添加到下面的"clientOptions"参数中来传递。

扩展的演示可以在这里找到

http://yii2fullcalendar.beeye.org/index.php/site/sly

安装

将此添加到您的composer.json require部分

  "philippfrenzel/yii2sly": "*",

最后,视图应该看起来像这样

<?php

use yii\helpers\Url;

?>

<h1><?php echo Html::encode($this->title); ?></h1>

<?= philippfrenzel\yii2sly\yii2sly::widget([
    'id' => 'sp_slider',
    'items'=> [
        ['content' => '<img src="' . Url::to('@web/img/sportster_forty-eight_sly.jpg') . '"></img>'],
        ['content' => '<img src="' . Url::to('@web/img/softtail_heritage-classic_sly.jpg') . '"></img>'],
        ['content' => '<img src="' . Url::to('@web/img/dyna_wide-glide_sly.jpg') . '"></img>'],
        ['content' => '<img src="' . Url::to('@web/img/cvo_limited_sly.jpg') . '"></img>'],
        ['content' => '<img src="' . Url::to('@web/img/v-rod_muscle_sly.jpg') . '"></img>']
    ],
    'options' => [
        'style' => "height:400px;"
    ],
    'clientOptions' => [
        'horizontal' => 1,
        'activateMiddle' => 1,
        ...
    ]
]); ?>

目前,它在与一个页面上存在多个sly时会引起问题,但我们知道这个问题,并且正在努力解决。