What is it?
Tiny Carousel is a lightweight carousel for sliding html based content. It was built using the javascript jQuery library. Tiny Carousel was designed to be a dynamic lightweight utility that gives webdesigners a powerful way of enhancing a websites user interface.
Features
- Completely rewritten!
- Can slide vertical or horizontal
- AMD, Node, requirejs and commonjs support.
- Supports navigation by button or paging
- The point where the carousel starts can be set
- Animation time can be set in milliseconds or to 'instant'
- A interval can be set to slide automatically every given milliseconds
- Loops infinitely over its slides.
- Responsive
- Easy customizable
- Lightweight
- Source is on GitHub
Examples
If you need some more (advanced) examples you can find them here.
$(document).ready(function()
{
$('#slider1').tinycarousel();
});
$(document).ready(function()
{
$("#slider3").tinycarousel({
bullets : true
});
});
$(document).ready(function()
{
$("#slider4").tinycarousel({
bullets : true
, buttons : false
, animation : false
});
});
$(document).ready(function()
{
$("#slider5").tinycarousel({
axis : "y"
});
});
$(document).ready(function()
{
$("#slider7").tinycarousel({ interval: true });
var slider7 = $("#slider7").data("plugin_tinycarousel");
// The move method you can use to make a
// anchor to a certain slide.
//
$('#gotoslide4').click(function()
{
slider7.move(4);
return false;
});
// The start method starts the interval.
//
$('#startslider').click(function()
{
slider7.start();
return false;
});
// The stop method stops the interval.
//
$('#stopslider').click(function()
{
slider7.stop();
return false;
});
});
Constructor
tinycarousel
(
options
)
|
Properties
_defaults | Object private |
Default: defaults |
_name | String private final |
Default: 'tinycarousel' |
intervalActive | Boolean |
If the interval is running the value will be true. Default: false |
options | Object |
The options of the carousel extend with the defaults. Default: defaults |
slideCurrent | Number |
The index of the current slide. Default: 0 |
slidesTotal | Number |
The number of slides the carousel is currently aware of. Default: 0 |
Methods
_initialize
()
|
_setButtons
()
|
_setEvents
()
|
move
(
index
)
Move to a specific slide.
|
start
()
If the interval is stoped start it. |
start
()
If the interval is running stop it. |
update
()
You can use this method to add new slides on the fly. Or to let the carousel recalculate itself. |
Events
move |
The move event will trigger when the carousel slides to a new slide. |
Usage
$(document).ready(function()
{
// Initialize a carousel like this.
//
var $box = $('#box');
$box.tinycarousel();
// Try this to get access to the actual carousel instance.
//
var box = $box.data("plugin_tinycarousel");
// Now you have access to all the methods and properties.
//
// box.update();
// console.log(box.slideCurrent);
//
// etc..
// You can bind to the move event like this.
//
$box.bind("move", function()
{
console.log("do something on every move to a new slide");
});
});