Submit your widget

Useful circular and responsive jQuery carousel

Created 12 years ago   Views 20787   downloads 4523    Author caroufredsel
Useful circular and responsive jQuery carousel
View DemoDownload
Share |

jQuery.carouFredSel is a plugin that turns any kind of HTML element into a carousel. It can scroll one or multiple items simultaneously, horizontal or vertical, infinite and circular, automatically or by user interaction. Oh, and it's responsive too.

1. Doctype

First, make sure you are using valid DOCTYPE. This is required for the carousels to look and function correctly.

2. Include nessesary .js files

Include the jQuery library and the carouFredSel-plugin inside the <head> tag of the page.

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.carouFredSel.js"></script>

3. Create scrollable content

Create a range of HTML elements and place them inside a container-element.

Example: A series of images.

<div id="foo">
	<img src="img1.jpg" width="300" />
	<img src="img2.jpg" width="300" />
	<img src="img3.jpg" width="300" />
	<img src="img4.jpg" width="300" />
	<img src="img5.jpg" width="300" />
	<img src="img6.jpg" width="300" />
	<img src="img7.jpg" width="300" />
	<img src="img8.jpg" width="300" />

Example: An ordered or unordered list.

<ul id="foo">
	<li> c </li>
	<li> a </li>
	<li> r </li>
	<li> o </li>
	<li> u </li>
	<li> F </li>
	<li> r </li>
	<li> e </li>
	<li> d </li>
	<li> S </li>
	<li> e </li>
	<li> l </li>

Example: Whatever HTML elements.

<div id="foo">
		<p>A concept that in many fields refers to a quantity without bound or end.</p>
		<h3>Circular journey</h3>
		<p>An excursion in which the final destination is the same as the starting point.</p>
		<p>jQuery  is a cross-browser JavaScript library designed to simplify the client-side scripting.</p>
		<p>A carousel is an amusement ride consisting of a rotating circular platform with seats.</p>

4. Fire the plugin

Fire the carouFredSel-plugin on the container-element. For all the configuration-options, have a look at the configuration-page.
If you are not familiar with jQuery, please, read this tutorial for beginners.

$(document).ready(function() {

	// Using default configuration
	// Using custom configuration
		items				: 2,
		direction			: "up",
		scroll : {
			items			: 1,
			easing			: "easeOutBounce",
			duration		: 1000,							
			pauseOnHover	: true

Note: After the plugin has been executed, the container-element has been wrapped inside a div-element with class="caroufredsel_wrapper".

The article source: