Yii 2.0: jquery-slider

Implementation for yii2 framework of jssor/jquery-slider
2 followers

Implementation for yii2 framework of jssor/jquery-slider

This is a fork of jssor/jquery-slider with an additionnal SliderWidget and SliderAsset for yii framework

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require "claudejanz/query-slider": "dev-master"

or add

"claudejanz/query-slider": "dev-master"

to the require section of your composer.json file.

Usage

use claudejanz\jquerySlider\widgets\SliderWidget;
use yii\web\JsExpression;
 
SliderWidget::begin([
    'responsive' => true,
    'options'=>['style'=>'position: relative; top: 0px; left: 0px; width: 600px; height: 300px;'],
    'pluginOptions' => [
        '$AutoPlay' => true,
        '$AutoPlayInterval' => 6000,
        '$SlideDuration' => 800,
        '$SlideshowOptions' => [
            '$Class' => new JsExpression('$JssorSlideshowRunner$'),
            '$Transitions' => [
                ['$Duration' => 700, '$Opacity' => 2, '$Brother' => ['$Duration' => 1000, '$Opacity' => 2]]
            ]
        ]
    ]
]);
echo '<div u="slides" style="cursor: move; position: absolute; overflow: hidden; left: 0px; top: 0px; width: 600px; height: 300px;">
                    <div><img u="image" src="images/01.jpg" /></div>
                    <div><img u="image" src="images/02.jpg" /></div>
                </div>';
SliderWidget::end();

More about plugin options on: http://www.jssor.com

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet