/******************************************** * revolution 5.0 extension - carousel * @version: 1.0.2 (01.10.2015) * @requires jquery.themepunch.revolution.js * @author themepunch *********************************************/ !function(){var e=jquery.fn.revolution;jquery.extend(!0,e,{preparecarousel:function(i,l,o){o=i.carousel.lastdirection=a(o,i.carousel.lastdirection),t(i),i.carousel.slide_offset_target=r(i),void 0==l?e.carouseltoevalposition(i,o):s(i,o,!1)},carouseltoevalposition:function(i,t){var l=i.carousel;t=l.lastdirection=a(t,l.lastdirection);var o="center"===l.horizontal_align?(l.wrapwidth/2-l.slide_width/2-l.slide_globaloffset)/l.slide_width:(0-l.slide_globaloffset)/l.slide_width,r=e.simp(o,i.slideamount,!1),n=r-math.floor(r),d=0,f=-1*(math.ceil(r)-r),h=-1*(math.floor(r)-r);d=n>=.3&&"left"===t||n>=.7&&"right"===t?f:.3>n&&"left"===t||.7>n&&"right"===t?h:d,d="off"===l.infinity?0>r?r:o>i.slideamount-1?o-(i.slideamount-1):d:d,l.slide_offset_target=d*l.slide_width,0!==math.abs(l.slide_offset_target)?s(i,t,!0):e.organisecarousel(i,t)},organisecarousel:function(e,i,t,a){i=void 0===i||"down"==i||"up"==i||null===i||jquery.isemptyobject(i)?"left":i;for(var s=e.carousel,l=new array,o=s.slides.length,r="right"===s.horizontal_align?r=e.width:0,n=0;o>n;n++){var d=n*s.slide_width+s.slide_offset;"on"===s.infinity&&(d=d>s.wrapwidth-s.inneroffset&&"right"==i?s.slide_offset-(s.slides.length-n)*s.slide_width:d,d=d<0-s.inneroffset-s.slide_width&&"left"==i?d+s.maxwidth:d),l[n]=d}var f=999;s.slides&&jquery.each(s.slides,function(a,r){var n=l[a];"on"===s.infinity&&(n=n>s.wrapwidth-s.inneroffset&&"left"===i?l[0]-(o-a)*s.slide_width:n,n=n<0-s.inneroffset-s.slide_width?"left"==i?n+s.maxwidth:"right"===i?l[o-1]+(a+1)*s.slide_width:n:n);var d=new object;d.left=n+s.inneroffset;var h="center"===s.horizontal_align?(math.abs(s.wrapwidth/2)-(d.left+s.slide_width/2))/s.slide_width:(s.inneroffset-d.left)/s.slide_width,w="center"===s.horizontal_align?2:1;if((t&&math.abs(h)h&&h>0?1-h:math.abs(h)>s.maxvisibleitems-1?1-(math.abs(h)-(s.maxvisibleitems-1)):1;break;case"right":d.autoalpha=h>-1&&0>h?1-math.abs(h):h>s.maxvisibleitems-1?1-(math.abs(h)-(s.maxvisibleitems-1)):1}else d.autoalpha=math.abs(h)0)if("on"===s.vary_scale){d.scale=1-math.abs(s.minscale/100/math.ceil(s.maxvisibleitems/w)*h);var c=(s.slide_width-s.slide_width*d.scale)*math.abs(h)}else{d.scale=h>=1||-1>=h?1-s.minscale/100:(100-s.minscale*math.abs(h))/100;var c=(s.slide_width-s.slide_width*(1-s.minscale/100))*math.abs(h)}void 0!==s.maxrotation&&0!=math.abs(s.maxrotation)&&("on"===s.vary_rotation?(d.rotationy=math.abs(s.maxrotation)-math.abs((1-math.abs(1/math.ceil(s.maxvisibleitems/w)*h))*s.maxrotation),d.autoalpha=math.abs(d.rotationy)>90?0:d.autoalpha):d.rotationy=h>=1||-1>=h?s.maxrotation:math.abs(h)*s.maxrotation,d.rotationy=0>h?-1*d.rotationy:d.rotationy),d.x=-1*s.space*h,d.left=math.floor(d.left),d.x=math.floor(d.x),void 0!==d.scale?0>h?d.x-c:d.x+c:d.x,d.zindex=math.round(100-math.abs(5*h)),d.transformstyle="3d"!=e.parallax.type&&"3d"!=e.parallax.type?"flat":"preserve-3d",punchgs.tweenlite.set(r,d)}),a&&(e.c.find(".next-revslide").removeclass("next-revslide"),jquery(s.slides[s.focused]).addclass("next-revslide"),e.c.trigger("revolution.nextslide.waiting"));s.wrapwidth/2-s.slide_offset,s.maxwidth+s.slide_offset-s.wrapwidth/2}});var i=function(e){var i=e.carousel;i.infbackup=i.infinity,i.maxvisiblebackup=i.maxvisibleitems,i.slide_globaloffset="none",i.slide_offset=0,i.wrap=e.c.find(".tp-carousel-wrapper"),i.slides=e.c.find(".tp-revslider-slidesli"),0!==i.maxrotation&&("3d"!=e.parallax.type&&"3d"!=e.parallax.type?punchgs.tweenlite.set(i.wrap,{perspective:1200,transformstyle:"flat"}):punchgs.tweenlite.set(i.wrap,{perspective:1600,transformstyle:"preserve-3d"})),void 0!==i.border_radius&&parseint(i.border_radius,0)>0&&punchgs.tweenlite.set(e.c.find(".tp-revslider-slidesli"),{borderradius:i.border_radius})},t=function(t){void 0===t.bw&&e.setsize(t);var a=t.carousel,s=e.gethorizontaloffset(t.c,"left"),l=e.gethorizontaloffset(t.c,"right");void 0===a.wrap&&i(t),a.slide_width="on"!==a.stretch?t.gridwidth[t.curwinrange]*t.bw:t.c.width(),a.maxwidth=t.slideamount*a.slide_width,a.maxvisiblebackup>a.slides.length+1&&(a.maxvisibleitems=a.slides.length+2),a.wrapwidth=a.maxvisibleitems*a.slide_width+(a.maxvisibleitems-1)*a.space,a.wrapwidth="auto"!=t.sliderlayout?a.wrapwidth>t.c.closest(".tp-simpleresponsive").width()?t.c.closest(".tp-simpleresponsive").width():a.wrapwidth:a.wrapwidth>t.ul.width()?t.ul.width():a.wrapwidth,a.infinity=a.wrapwidth>=a.maxwidth?"off":a.infbackup,a.wrapoffset="center"===a.horizontal_align?(t.c.width()-l-s-a.wrapwidth)/2:0,a.wrapoffset="auto"!=t.sliderlayout&&t.outernav?0:a.wrapoffsetmath.abs(i)?e>0?e-math.abs(math.floor(e/i)*i):e+math.abs(math.floor(e/i)*i):e},o=function(e,i,t){var t,t,a=i-e,s=i-t-e;return a=l(a,t),s=l(s,t),math.abs(a)>math.abs(s)?s:a},r=function(i){var t=0,a=i.carousel;if(void 0!==a.positionanim&&a.positionanim.kill(),"none"==a.slide_globaloffset)a.slide_globaloffset=t="center"===a.horizontal_align?a.wrapwidth/2-a.slide_width/2:0;else{a.slide_globaloffset=a.slide_offset,a.slide_offset=0;var s=i.c.find(".processing-revslide").index(),l="center"===a.horizontal_align?(a.wrapwidth/2-a.slide_width/2-a.slide_globaloffset)/a.slide_width:(0-a.slide_globaloffset)/a.slide_width;l=e.simp(l,i.slideamount,!1),s=s>=0?s:i.c.find(".active-revslide").index(),s=s>=0?s:0,t="off"===a.infinity?l-s:-o(l,s,i.slideamount),t*=a.slide_width}return t}}(jquery);