/*! * Excolo Slider - A simple jquery slider * * Examples and documentation at: * http://excolo.github.io/Excolo-Slider/ * * Author: Nikolaj Dam Larsen * Version: 1.1.0 (16-MAY-2014) * * Released under the MIT license * https://github.com/Excolo/ExcoloSlider/blob/master/LICENSE */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else { // Browser globals factory(jQuery); } }(function ($) { var Plugin; /* Plugin Definition **************************************************************/ Plugin = (function () { function Plugin(elem, options) { this.elem = elem; this.$elem = $(elem); this.options = options; // This next line takes advantage of HTML5 data attributes // to support customization of the plugin on a per-element // basis. this.metadata = this.$elem.data('plugin-options'); } return Plugin; })(); /* Plugin prototype **************************************************************/ Plugin.prototype = { /* Default Configuration **********************************************************/ defaults: { width: 640, height: 260, autoSize: true, touchNav: true, mouseNav: true, prevnextNav: true, prevnextAutoHide: true, pagerNav: true, startSlide: 1, autoPlay: true, delay: 0, interval: 3000, repeat: true, playReverse: false, hoverPause: true, captionAutoHide: false, animationCssTransitions: true, animationDuration: 500, animationTimingFunction: "linear", prevButtonClass: "slide-prev", nextButtonClass: "slide-next", activeSlideClass: "es-active", slideCaptionClass: "es-caption", pagerClass: "es-pager", }, /* Initialization function **********************************************************/ init: function () { var base, maxHeight, $prev, $next, $buttons, $innerBase, caption, $wrapper, $children, $container; // Defined variable to avoid scope problems base = this; // Introduce defaults that can be extended either globally or using an object literal. base.config = $.extend({}, base.defaults, base.options, base.metadata); base.actionClick={action:false,x:0,y:0}; base.currClick={x:0,y:0}; // Initialize plugin data base.data = $.data(base); $.data(base, "currentSlide", base.config.playReverse && base.config.startSlide == 1 ? base.$elem.children().length-1 : base.config.startSlide - 1); $.data(base, "nextSlide", base.data.currentSlide); $.data(base, "totalslides", base.$elem.children().length); $.data(base, "browserEnginePrefix", base._getBrowserEnginePrefix()); $.data(base, "isPlaying", false); $.data(base, "isAnimating", false); $.data(base, "playPaused", false); $.data(base, "justTouched", false); $.data(base, "isMoving", false); $.data(base, "width", base.config.width); // Create helper html objects base.$elem.addClass("slider"); base.$elem.css({ position: "relative" }); base.$elem.wrapInner("