2017 © Pedro Peláez
 

yii2-extension yii2-revslider

Simple slider widget

image

webcreator/yii2-revslider

Simple slider widget

  • Saturday, August 27, 2016
  • by olegwebcreator
  • Repository
  • 1 Watchers
  • 1 Stars
  • 47 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 21 % Grown

The README.md

Revolution slider for yii2

Simple slider widget, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist webcreator/yii2-revslider "*"

or add, (*4)

"webcreator/yii2-revslider": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

= \webcreator\revslider\AutoloadExample::widget(); ?>

There are a lot of parameters you can use in this widget. Here is the code for 3 slides with 4 section in each slide, (*7)

 [
        "delay" => 15000,
        "startwidth"  => 1170,
        "startheight" => 500,
        "fullWidth"   => "on",
        "fullScreen"  => "off",
        "hideCaptionAtLimit" => "",
        "dottedOverlay" => "twoxtwo",
        "navigationStyle" => "preview4",
        "fullScreenOffsetContainer" => "",
        "hideTimerBar" => "on"
    ],
    "items" => [
        [
            "id" => 1,
            "title" => "Slide title",
            "bgImg" => "path to background image",
            "bgImgTitle" => "Alt title for background image",
            "masterspeed" => 2000,
            "enabled" => 1,
            "transition" => "slidehorizontal",
            "slotamount" => 5,
            "slides" => [
                [
                    "slideNumber" => 1,
                    "options" => [
                        "img" => "path to image",
                        "imgTitle" => "Alt title for image"
                    ],
                    "data" => [
                        "hoffset" => 0,
                        "x" => 600,
                        "y" => 54,
                        "speed" => 800,
                        "start" => 1100,
                        "easing" => "Back.easeInOut",
                        "endeasing" => 300,
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 2,
                    "options" => [
                        "title" => "Title",
                        "subtitle" => "Subtitle"
                    ],
                    "data" => [
                        "hoffset" => 0,
                        "y" => 54,
                        "speed" => 800,
                        "start" => 1200,
                        "easing" => "Back.easeInOut",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 3,
                    "options" => [
                        "title" => "Title"
                    ],
                    "data" => [
                        "hoffset" => 0,
                        "y" => 380,
                        "speed" => 800,
                        "start" => 1300,
                        "easing" => "Power4.easeInOut",
                        "endeasing" => "Power1.easeIn",
                        "captionHidden" => "off",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 4,
                    "options" => [
                        "link" => "link to page"
                    ],
                    "data" => [
                        "hoffset" => 0,
                        "y" => 420,
                        "speed" => 800,
                        "start" => 1400,
                        "easing" => "Power4.easeInOut",
                        "endeasing" => "Power1.easeIn",
                        "captionHidden" => "off",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ]
            ]
        ],
        [
            "id" => 2,
            "title" => "Slide title",
            "bgImg" => "path to background image",
            "bgImgTitle" => "Alt title for background image",
            "masterspeed" => 2000,
            "enabled" => 1,
            "transition" => "slidehorizontal",
            "slotamount" => 5,
            "slides" => [
                [
                    "slideNumber" => 1,
                    "options" => [
                        "img" => "path to image",
                        "imgTitle" => "Alt title for image"
                    ],
                    "data" => [
                        "x" => 0,
                        "y" => 54,
                        "speed" => 800,
                        "start" => 1100,
                        "easing" => "Back.easeInOut",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 2,
                    "options" => [
                        "title" => "Title",
                    ],
                    "data" => [
                        "x" => 410,
                        "y" => 54,
                        "speed" => 800,
                        "start" => 1200,
                        "easing" => "Back.easeInOut",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 3,
                    "options" => [
                        "title" => "Title",
                        "subtitle" => "Subtitle"
                    ],
                    "data" => [
                        "x" => 410,
                        "y" => 100,
                        "speed" => 800,
                        "start" => 1300,
                        "easing" => "Power4.easeInOut",
                        "endeasing" => "Power1.easeIn",
                        "captionHidden" => "off",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 4,
                    "options" => [
                        "link" => "link to page"
                    ],
                    "data" => [
                        "x" => 860,
                        "y" => 400,
                        "speed" => 800,
                        "start" => 1400,
                        "easing" => "Power4.easeInOut",
                        "endeasing" => "Power1.easeIn",
                        "captionHidden" => "off",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ]
            ]
        ],
        [
            "id" => 3,
            "title" => "Slide title",
            "bgImg" => "path to background image",
            "bgImgTitle" => "Alt title for background image",
            "masterspeed" => 2000,
            "enabled" => 1,
            "transition" => "slidehorizontal",
            "slotamount" => 5,
            "slides" => [
                [
                    "slideNumber" => 1,
                    "options" => [
                        "img" => "path to image",
                        "imgTitle" => "alt image title"
                    ],
                    "data" => [
                        "x" => 0,
                        "y" => 54,
                        "speed" => 800,
                        "start" => 1100,
                        "easing" => "Back.easeInOut",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 2,
                    "options" => [
                        "title" => "Title",
                        "subtitle" => "Subtitle"
                    ],
                    "data" => [
                        "hoffset" => 0,
                        "x" => 410,
                        "y" => 54,
                        "speed" => 800,
                        "start" => 1200,
                        "easing" => "Back.easeInOut",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 3,
                    "options" => [
                        "title" => "Title",
                    ],
                    "data" => [
                        "hoffset" => 0,
                        "x" => 410,
                        "y" => 300,
                        "speed" => 800,
                        "start" => 1300,
                        "easing" => "Power4.easeInOut",
                        "endeasing" => "Power1.easeIn",
                        "captionHidden" => "off",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ],
                [
                    "slideNumber" => 4,
                    "options" => [
                        "link" => "link to page"
                    ],
                    "data" => [
                        "x" => 800,
                        "y" => 360,
                        "speed" => 800,
                        "start" => 1400,
                        "easing" => "Power4.easeInOut",
                        "endeasing" => "Power1.easeIn",
                        "captionHidden" => "off",
                        "endspeed" => 300
                    ],
                    "enabled" => 1
                ]
            ]
        ]
    ]
]);
Slider::end();
?>

The Versions

27/08 2016

dev-master

9999999-dev https://github.com/olegwebcreator/yii2-revslider

Simple slider widget

  Sources   Download

BSD-3-Clause

The Requires

 

by Oleg Nazarov

extension yii2 slider revolution