/*! * jQuery Mobile Carousel * Source: https://github.com/blackdynamo/jQuery-Mobile-Carousel * Demo: http://jsfiddle.net/blackdynamo/yxhzU/ * Blog: http://developingwithstyle.blogspot.com * * Copyright 2010, Donnovan Lewis * Edits: Benjamin Gleitzman (gleitz@mit.edu) * Licensed under the MIT */ (function($) { $.fn.carousel = function(options) { var settings = { duration: 300, direction: "horizontal", minimumDrag: 20, beforeStart: function(){}, afterStart: function(){}, beforeStop: function(){}, afterStop: function(){} }; $.extend(settings, options || {}); return this.each(function() { if (this.tagName.toLowerCase() != "ul") return; var originalList = $(this); var pages = originalList.children(); var width = originalList.parent().width(); var height = originalList.parent().height(); //Css var containerCss = {position: "relative", overflow: "hidden", width: width, height: height}; var listCss = {position: "relative", padding: "0", margin: "0", listStyle: "none", width: pages.length * width}; var listItemCss = {width: width, height: height}; var container = $("
").css(containerCss); var list = $("