/** * Author: Vinayak Rangnathrao Jadhav * Project: jRCarousel * Version: 0.1 */ (function(f){"function"===typeof define&&define.amd?define(["jquery"],f):"object"===typeof exports?module.exports=f(require("jquery")):f(jQuery)})(function(f){f.fn.jRCarousel=function(y){function e(){return c.find(".slide").last()}function q(){return c.find(".slide").first()}function r(b){return c.find(".slide[data-index="+b+"]")}function v(){this.animations={slide:z,scroll:A,fade:B,zoomInSlide:C,zoomInScroll:D}}function l(d){d=d||q();a=e();g=d.data("index");var f=a.data("index");if(f==g)return-1; c.find(".slide").not(a[0]).hide();d.show();if(f").css({display:"block",position:"relative",overflow:"hidden",width:"100%", height:"100%"}).appendTo(h),a,g,w=new v,t,u,n;(function(){function d(){t=f("");u=f("");t.add(u).appendTo(c).css({position:"absolute",top:"42%",zIndex:1,display:"inline-block",padding:"18px",boxShadow:"7px 7px 0 1px #777 inset",cursor:"pointer",opacity:"0.7"}).hide();t.on("click",function(){c.find(".controls").hide();l(c.find(".slide").eq(-2))}); u.on("click",function(){c.find(".controls").hide();l(q())});h.hover(function(){c.find(".controls").fadeIn()},function(){c.find(".controls").fadeOut()})}function e(){for(var a=b.navigation,d=f("");"circles"==a?d.find(".nav").css({border:"0 dashed #ccc",borderRadius:"12px"}):"squares"==a&&d.find(".nav").css({border:"0 dotted #fff"});d.find(".nav").css({display:"inline-block",margin:"4px", cursor:"pointer",backgroundColor:"#777",width:"12px",height:"12px"}).first().css({borderWidth:"2px"});c.after(d);h.on("click",".nav",function(){l(r(f(this).index()))}).css({marginBottom:"24px"})}function g(){n=setInterval(l,b.animationInterval+b.animationSpeed);c.find(".controls").hide();h.hover(function(){clearInterval(n);n=0;c.find(".controls").fadeIn()},function(){c.find(".controls").fadeOut();n=setInterval(l,b.animationInterval+b.animationSpeed)})}(function(){if(b.slides.length)for(var d=0;d< b.slides.length;d++){var e=f("").prop({src:b.slides[d].src,alt:"'"+b.slides[d].src+"'"}).detach();c.append(e)}else h.find(".slide").each(function(a){a=f(this).attr("data-index",a).detach();c.append(a)});c.find(".slide").css({position:"absolute",left:0,top:0,width:"100%",height:"100%",objectFit:b.slideLayout,backgroundColor:"#fff"});c.find(".slide img").css({width:"100%",height:"100%",objectFit:b.slideLayout});a=c.find(".slide").first().detach();c.append(a);h.css({width:m+ "px",height:p+"px"})})();b.controls&&d();b.navigation&&e();b.autoplay&&g();addEventListener("resize",x);x();jQuery.fx.interval=7})();v.prototype.run=function(a,b){this.animations[a](b)};this.showSlide=function(a){l(r(a))};this.getCurrentSlide=function(){return e()};this.getSlideByIndex=function(a){return r(a)};this.showPreviousSlide=function(){l(c.find(".slide").eq(-2))};this.showNextSlide=function(){l(q())};return this}});