-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslideProjectorCarousel.min.js
More file actions
8 lines (8 loc) · 2.53 KB
/
slideProjectorCarousel.min.js
File metadata and controls
8 lines (8 loc) · 2.53 KB
1
2
3
4
5
6
7
8
/*!
slideProjectorCarousel v1.0.3 (https://github.com/TechTarget/slideProjectorCarousel)
Author: Morgan Wigmanich <okize123@gmail.com> (http://github.com/okize)
Copyright (c) 2013 | Licensed under the MIT license
http://www.opensource.org/licenses/mit-license.php
*/
(function(){!function(t){return"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){var e,i,n;return e=function(e,s){return this.element=e,this.options=t.extend({},i,s),this._defaults=i,this._name=n,this.init()},n="slideProjectorCarousel",i={autoplay:!0,autoplaySpeed:5e3,slidesToShow:3,slidesToMove:3},e.prototype.init=function(){var e,i,n,s,o,a,r,l,d,u,f,c,p,v,h,x;return d=this.options,s=t(this.element),u=s.find(".projection"),f=u.find("li"),h=s.find(".slides"),x=h.find("ul"),v=x.find("li"),p=0,c=v.length,o=-1,l=0,n=s.data("autoplay"),r={},e=function(){return r.btnPrevious=t("<a>",{"class":"slideControls previous disabled",href:"#",title:"Previous",text:"Previous"}).on("click",function(e){return e.preventDefault(),t(this).hasClass("disabled")?void 0:h.trigger("slides.move","previous")}),r.btnNext=t("<a>",{"class":"slideControls next",href:"#",title:"Next",text:"Next"}).on("click",function(e){return e.preventDefault(),t(this).hasClass("disabled")?void 0:h.trigger("slides.move","next")}),h.addClass("hasControls").append(r.btnPrevious,r.btnNext),p=v.outerWidth()},a=function(t,e){return"previous"===e&&(r.btnPrevious.addClass("disabled"),r.btnNext.removeClass("disabled"),x.css("left",0)),"next"===e?(r.btnPrevious.removeClass("disabled"),r.btnNext.addClass("disabled"),x.css("left",-(p*d.slidesToMove))):void 0},"undefined"!=typeof n&&(n>0?(d.autoplay=!0,d.autoplaySpeed=n):(d.autoplay=!1,d.autoplaySpeed=0)),i={start:function(){return this.timer=setTimeout(t.proxy(this.getNextSlide,this),d.autoplaySpeed)},getNextSlide:function(){return l=l===c-1?0:l+1,v.eq(l).trigger("click")},stop:function(){return clearTimeout(this.timer)}},v.on("click",function(e){var n,s;return e.preventDefault(),d.autoplay&&i.stop(),v.removeClass("active"),n=t(this),n.addClass("active"),s=n.index(),o=s,l=s,f.css("z-index",0),f.eq(s).css({"z-index":1,top:0}),d.autoplay?i.start():void 0}),f.on("click",function(e){var i,n;return e.preventDefault(),i=t(this).find("a"),n=i.attr("target")?"_blank":"_self",window.open(i.attr("href"),n)}),c>d.slidesToShow&&e(),d.autoplay&&i.start(),h.on("slides.move",a)},t.fn[n]=function(i){return this.each(function(){return t.data(this,"plugin_"+n)?void 0:t.data(this,"plugin_"+n,new e(this,i))})}})}).call(this);
//# sourceMappingURL=slideProjectorCarousel.min.js.map