/*! ResponsiveSlides.js v1.0. (c) 2011 Viljami Salminen. MIT License. http://responsive-slides.viljamis.com */ (function ($) { $.fn.responsiveSlides = function (options) { // Settings var settings = { 'speed' : 4000, 'fade' : 1000, 'auto' : true, 'maxwidth' : 'none', 'namespace' : 'responsiveSlides' }; return this.each(function () { var $this = $(this); if (options) { $.extend(settings, options); } // Don't run if there's only one image if ($this.find('img').length <= 1) { return; } var slideshow = function () { var $slides = $this.find('img'); $slides.each(function (i) { var $el = $(this); $el.attr({ id : settings.namespace + '_slide' + i }); }); $slides.css({ top: 0, left: 0, width: '100%', height: 'inherit', position: 'absolute' }); $this.find(':first-child').addClass(settings.namespace + '_visible'); $this.css({ 'max-width': parseFloat(settings.maxwidth), width: '100%', overflow: 'hidden', position: 'relative' }); // Dirty attempt to fix the height heightFix = [ '' ].join(''); $('head').append(heightFix); // Auto: true if (settings.auto === true) { $this.find('img:gt(0)').hide(); setInterval(function () { $this.find(':first-child').fadeOut(parseFloat(settings.fade)) .next('img').fadeIn(parseFloat(settings.fade)) .addClass(settings.namespace + '_visible').end().appendTo($this) .removeClass(settings.namespace + '_visible'); }, parseFloat(settings.speed)); // Auto: false } else { var $pagination = $('