(function() { (function($, window, document) { var Plugin, defaults, pluginName; pluginName = "slidesjs"; defaults = { width: 1002, height: 369, start: 1, navigation: { active: true, effect: "slide" }, pagination: { active: true, effect: "slide" }, play: { active: false, effect: "slide", interval: 5000, auto: true, swap: true, pauseOnHover: false, restartDelay: 2500 }, effect: { slide: { speed: 500 }, fade: { speed: 300, crossfade: true } }, callback: { loaded: function() {}, start: function() {}, complete: function() {} } }; Plugin = (function() { function Plugin(element, options) { this.element = element; this.options = $.extend(true, {}, defaults, options); this._defaults = defaults; this._name = pluginName; this.init(); } return Plugin; })(); Plugin.prototype.init = function() { var $element, nextButton, pagination, playButton, prevButton, stopButton, _this = this; $element = $(this.element); this.data = $.data(this); $.data(this, "animating", false); $.data(this, "total", $element.children().not(".slidesjs-navigation", $element).length); $.data(this, "current", this.options.start - 1); $.data(this, "vendorPrefix", this._getVendorPrefix()); if (typeof TouchEvent !== "undefined") { $.data(this, "touch", true); this.options.effect.slide.speed = this.options.effect.slide.speed / 2; } $element.css({ overflow: "hidden" }); $element.slidesContainer = $element.children().not(".slidesjs-navigation", $element).wrapAll("
", $element).parent().css({ overflow: "hidden", position: "relative" }); $(".slidesjs-container", $element).wrapInner("
", $element).children(); $(".slidesjs-control", $element).css({ position: "relative", left: 0 }); $(".slidesjs-control", $element).children().addClass("slidesjs-slide").css({ position: "absolute", top: 0, left: 0, width: "100%", zIndex: 0, display: "none", webkitBackfaceVisibility: "hidden" }); $.each($(".slidesjs-control", $element).children(), function(i) { var $slide; $slide = $(this); return $slide.attr("slidesjs-index", i); }); if (this.data.touch) { $(".slidesjs-control", $element).on("touchstart", function(e) { return _this._touchstart(e); }); $(".slidesjs-control", $element).on("touchmove", function(e) { return _this._touchmove(e); }); $(".slidesjs-control", $element).on("touchend", function(e) { return _this._touchend(e); }); } $element.fadeIn(0); this.update(); if (this.data.touch) { this._setuptouch(); } $(".slidesjs-control", $element).children(":eq(" + this.data.current + ")").eq(0).fadeIn(0, function() { return $(this).css({ zIndex: 10 }); }); if (this.options.navigation.active) { prevButton = $("", { "class": "slidesjs-previous slidesjs-navigation", href: "#", title: "Previous", text: "Previous" }).appendTo($element); nextButton = $("", { "class": "slidesjs-next slidesjs-navigation", href: "#", title: "Next", text: "Next" }).appendTo($element); } $(".slidesjs-next", $element).click(function(e) { e.preventDefault(); _this.stop(true); return _this.next(_this.options.navigation.effect); }); $(".slidesjs-previous", $element).click(function(e) { e.preventDefault(); _this.stop(true); return _this.previous(_this.options.navigation.effect); }); if (this.options.play.active) { playButton = $("", { "class": "slidesjs-play slidesjs-navigation", href: "#", title: "Play", text: "Play" }).appendTo($element); stopButton = $("", { "class": "slidesjs-stop slidesjs-navigation", href: "#", title: "Stop", text: "Stop" }).appendTo($element); playButton.click(function(e) { e.preventDefault(); return _this.play(true); }); stopButton.click(function(e) { e.preventDefault(); return _this.stop(true); }); if (this.options.play.swap) { stopButton.css({ display: "none" }); } } if (this.options.pagination.active) { pagination = $("