/* * loopedSlider 0.5.5 - jQuery plugin * written by Nathan Searles * http://nathansearles.com/loopedslider/ * * Copyright (c) 2009 Nathan Searles (http://nathansearles.com/) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * Built for jQuery library * http://jquery.com * Compatible with jQuery 1.3+ * */ /* * markup example for $("#loopedSlider").loopedSlider(); * *
*
*
*
*
*
*
*
*
* * *
* */ (function($) { $.fn.loopedSlider = function(options) { var defaults = { container: ".container", //Class/id of main container. You can use "#container" for an id. slides: ".slides", //Class/id of slide container. You can use "#slides" for an id. pagination: "pagination", //Class name of parent ul for numbered links. Don't add a "." here. containerClick: false, //Click slider to goto next slide? true/false autoStart: 0, //Set to positive number for true. This number will be the time between transitions. restart: 0, //Set to positive number for true. Sets time until autoStart is restarted. slidespeed: 300, //Speed of slide animation, 1000 = 1second. fadespeed: 200, //Speed of fade animation, 1000 = 1second. autoHeight: 0, //Set to positive number for true. This number will be the speed of the animation. addPagination: false //Add pagination links based on content? true/false }; this.each(function() { var obj = $(this); var o = $.extend(defaults,options); var distance = 0; var times = 1; var slides = $(o.slides,obj).children().size(); var width = $(o.slides,obj).children().outerWidth(); var position = 0; var active = false; var number = 0; var interval = 0; var restart = 0; var pagination = $("."+o.pagination+" li a",obj); if(o.addPagination && !$(pagination).length){ var buttons = slides; $(obj).append("