(function() { (function($, window, document) { var plugin, defaults, pluginname; pluginname = "slidesjs"; defaults = { width: 940, height: 528, start: 1, navigation: { active: true, effect: "slide" }, pagination: { active: true, effect: "slide" }, play: { active: false, effect: "slide", interval: 5000, auto: false, 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 = $("