Liquid syntax error: Unknown tag 'version'

Carousel Boilerplate Script

Many projects need a carousel of some sort. As most libraries or plugins are big and not so easy to extend I did what any respectable developer would do. I reinvented the wheel and created my own Carousel.

The Carousel is a plain and simple slider. It slides a ul behind an element which has overflow: hidden. Get the code on Github. The cloned code contains a simple example.

How to use

A very simple setup could look like this:

$(function()
{
	var carouselOpts =
	{
		prev: '.carousel-prev',
		next: '.carousel-next',
		loop: false,
		auto: false,
		startAt: 2,
		speed: 1000
	},

	carouselInstance = new Carousel.Base($('.carousel'), carouselOpts),
	carouselPager = new Carousel.Pager($('.carousel-pager'));
	
	// Or as a jQuery plugin		
	$('.carousel').carousel(carouselOpts);
	$('.carousel-pager').carouselPager();
});

Options

For the Carousel.Base class:

For the Carousel.Pager class:

Events

The Carousel publishes beforemove and aftermove events. Both events have the following data attached:

The carousel also listens to events:

Trigger an event like this:

// with paramaters:
$('<carousel_selector>').trigger(
{
	type: 'moveTo',
	index: 3
});

// without paramaters:
$('<carousel_selector>').trigger('stop');

Public functions

If you don’t want to use event based communication you can also use the public functions exposed by the Carousel.Base class.

Dependencies

This Carousel makes use of jQuery and Morpheus.

Easing

The Carousel uses easing-js to to do it’s fancy easings. Check out which ones you can use on their documentation page.

Liquid syntax error: Unknown tag 'version'