Options, Methods, APIs
All configurable options
Options:
Configurable options
Option | Type | Default | Description |
---|---|---|---|
orientation | String | v | Set the orientation of animation. v/h (v)ertical rotation will be in the x axis, (h) animation will be in the y axis |
perspective | Int | 1200 | Set the 3d css3 perspective. Lower values gives a large perspective. 1200 is the reccomended value. |
cubesNum | Int/Object | {rows:1, cols:1} | Set the rows and cols of cubes to slice the image. Example {rows:1 , cols:1} shows a single big cube, {rows:2, cols:2} shows 4 cubes. TRY! |
random | Bool | false | If set to random orientation and cubes will be randomized. cubeNum values will be used as maximum values. |
spreadPixel | Int | 0 | Set the number of pixel by with the cubes expand during animation. Gives an elastic animation. |
backfacesColor | HTML color | '#222' | Set the color (in html color notation) of the backfaces of cubes. Can be transparent. |
cubeSync | Int | 0 | Set the time in milliseconds of the cubes sincronization during animation. 0 means that cubes will animate at the same time. |
animationSpeed | Int | 800 | The time in milliseconds of the animatino of single cubes. |
easing | String | 'ease' | Set the animation to be used for the css3 3d mode slide. For a complete list of easings or timing functions please refer to Mozilla. |
fallbackEasing | String | 'easeOutExpo' | Set the animation to be used for the fallback standard slide. Use standard jquery easings. See below for more easings. |
autoplay | Bool | false | Set the autoplay mode. True images with slide automatically every autoplayInterval time. |
autoplayInterval | Int | 2000 | autoplayInterval time in milliseconds of autoplay. |
mode3d | Bool/String | auto | If auto the plugin will choose the best supported mode for the browser.If set to false it will force fallback standard sliding. |
arrows | Bool | true | Tell to show or hide left and right arrows navigation. |
navigation | Bool | true | Tell if to show or hide navigation bullets. |
play | Bool | true | Show or hide the play/pause button. |
titleSpeed | Int | 300 | The show speed of title in milliseconds. |
titleEasing | String | easeOutExpo | The animation easing of the title. |
jQuery Easings for fallback transitions
Possible transition are the following that uses cube-beizer equations:
- easeInQuad
- easeInCubic
- easeInQuart
- easeInQuint
- easeInSine
- easeInExpo
- easeInCirc
- easeInBack
- easeOutQuad
- easeOutCubic
- easeOutQuart
- easeOutQuint
- easeOutSine
- easeOutExpo
- easeOutCirc
- easeOutBack
- easeInOutQuad
- easeInOutCubic
- easeInOutQuart
- easeInOutQuint
- easeInOutSine
- easeInOutExpo
- easeInOutCirc
- easeInOutBack
For more information on the easing type see the jQuery easing plugin (that is integrated inside the slider plugin)
Methods, API:
This is the first version of the plugin, I have not added any method or callback. This options will be added on the next verions depending on users request or sell quantity.
Method | Description | Example |
---|---|---|
destroy | Destroys the plugin. | NO APIS FOR THE MOMENT |
Setup with links:
The Cube slider can be set up to work with images wrapped into links, so on image click a link is opened for another page
For settings up the links just follow the Basic Setup instruction and change only the step 3 as follow:
- Create a DIV tag where to set the image list. Also optionally for each image you can set a title
that will be shown during slider:
<div id="demo"> <a href="http://www.google.com/" target="_blank"> <img src="image/image1.jpg" title="sometitle to show on slide" /> </a> <a href="http://www.facebook.com/" target="_blank"> <img src="image/image2.jpg" title="sometitle to show on slide" /> </a> <a href="http://www.yahoo.com/" target="_blank"> <img src="image/image3.jpg" title="sometitle to show on slide" /> </a> <a href="http://www.albanx.com/" target="_blank"> <img src="image/image4.jpg" title="sometitle to show on slide" /> </a> </div>
Setup title:
There are two way to add titles: 1)When image is wrapped in link or container, just add inside the container a span with class cs-title and write there the title, this allows to add custom html code in the title 2) Just define the title attribute of the top element. The first way has priority on the second on. In the following examples both method are used:
- Create a DIV tag where to set the image list. Also optionally for each image you can set a title
that will be shown during slider:
<div id="demo"> <a href="http://www.google.com/" target="_blank"> <img src="image/image1.jpg" /> <div class="cs-title"> This is a example 1 title, I can add here custom HTML </div> </a> <a href="http://www.facebook.com/" title="This is a example 2 title, I cannot add here custom HTML" target="_blank"> <img src="image/image2.jpg" /> <div class="cs-title"> This image 2 </div> </a> <img src="image/image3.jpg" title="Another example 2" /> <img src="image/image4.jpg" title="Another example 2" /> </div>
Examples
For live examples open the examples folder inside the downloaded package.
Contacts
For questions, bugs and suggestions contact me at albanx[at]gmail[dot]com, or visit my web site www.albanx.com