(function ($, undefined) { /* * Slider object. */ $.Slider = function (options, element) { this.$el = $(element); this._init(options); }; $.Slider.defaults = { width:1170, //Max slider width height:500, //max slider height current: 0, // index of current slide bgincrement: 100, // increment the bg position (parallax effect) when sliding autoplay: true, // slideshow on / off interval: 6000 // time between transitions }; $.Slider.prototype = { _init: function (options) { var self = this; this.options = $.extend(true, {}, $.Slider.defaults, options); this.ratio = this.$el.width() / this.$el.height(); this.$slides = this.$el.children().children('.da-slide'); this.slidesCount = this.$slides.length; this.current = this.options.current; if (this.current < 0 || this.current >= this.slidesCount) { this.current = 0; } this.$slides.eq(this.current).addClass('da-slide-current'); var $navigation = $('