revolution.extension.slideanims.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444
  1. /************************************************
  2. * REVOLUTION 5.4.2 EXTENSION - SLIDE ANIMATIONS
  3. * @version: 1.8 (17.05.2017)
  4. * @requires jquery.themepunch.revolution.js
  5. * @author ThemePunch
  6. ************************************************/
  7. (function($) {
  8. "use strict";
  9. var _R = jQuery.fn.revolution,
  10. extension = { alias:"SlideAnimations Min JS",
  11. name:"revolution.extensions.slideanims.min.js",
  12. min_core: "5.4.5",
  13. version:"1.8"
  14. };
  15. ///////////////////////////////////////////
  16. // EXTENDED FUNCTIONS AVAILABLE GLOBAL //
  17. ///////////////////////////////////////////
  18. jQuery.extend(true,_R, {
  19. animateSlide : function(nexttrans, comingtransition, container, nextli, actli, nextsh, actsh, mtl) {
  20. if (_R.compare_version(extension).check==="stop") return mtl;
  21. return animateSlideIntern(nexttrans, comingtransition, container, nextli, actli, nextsh, actsh, mtl)
  22. }
  23. });
  24. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  25. /////////////////////////////////////////////////////////////////////////////// SLIDE TRANSITION MODULES ////////////////////////////////////////////////////
  26. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  27. //////////////////////////////////////////////////////
  28. //
  29. // * Revolution Slider - TRANSITION PREDEFINITION MODULES
  30. // * @version: 5.0.0 (13.02.2015)
  31. // * @author ThemePunch
  32. //
  33. //////////////////////////////////////////////////////
  34. ///////////////////////
  35. // PREPARE THE SLIDE //
  36. //////////////////////
  37. var prepareOneSlide = function(slotholder,opt,visible,vorh) {
  38. var sh=slotholder,
  39. img = sh.find('.defaultimg'),
  40. mediafilter = img.data('mediafilter'),
  41. scalestart = sh.data('zoomstart'),
  42. rotatestart = sh.data('rotationstart');
  43. if (img.data('currotate')!=undefined)
  44. rotatestart = img.data('currotate');
  45. if (img.data('curscale')!=undefined && vorh=="box")
  46. scalestart = img.data('curscale')*100;
  47. else
  48. if (img.data('curscale')!=undefined)
  49. scalestart = img.data('curscale');
  50. _R.slotSize(img,opt);
  51. var src = img.attr('src'),
  52. bgcolor=img.data('bgcolor'),
  53. w = opt.width,
  54. h = opt.height,
  55. fulloff = img.data("fxof"),
  56. fullyoff=0;
  57. if (bgcolor===undefined) bgcolor = img.css("backgroundColor");
  58. if (opt.autoHeight=="on") h = opt.c.height();
  59. if (fulloff==undefined) fulloff=0;
  60. var off=0,
  61. bgfit = img.data('bgfit'),
  62. bgrepeat = img.data('bgrepeat'),
  63. bgposition = img.data('bgposition');
  64. if (bgfit==undefined) bgfit="cover";
  65. if (bgrepeat==undefined) bgrepeat="no-repeat";
  66. if (bgposition==undefined) bgposition="center center";
  67. var bgstyle ='';
  68. if (bgcolor!==undefined && bgcolor.indexOf('gradient')>=0) {
  69. bgstyle = 'background:'+bgcolor;
  70. } else {
  71. bgstyle = 'background-color:'+bgcolor+';'+'background-image:url('+src+');'+'background-repeat:'+bgrepeat+';'+'background-size:'+bgfit+';background-position:'+bgposition;
  72. }
  73. switch (vorh) {
  74. // BOX ANIMATION PREPARING
  75. case "box":
  76. // SET THE MINIMAL SIZE OF A BOX
  77. //var basicsize = 0,
  78. var x = 0,
  79. y = 0;
  80. /*if (opt.sloth>opt.slotw)
  81. basicsize=opt.sloth
  82. else
  83. basicsize=opt.slotw;
  84. opt.slotw = basicsize;
  85. opt.sloth = basicsize;*/
  86. for (var j=0;j<opt.slots;j++) {
  87. y=0;
  88. for (var i=0;i<opt.slots;i++) {
  89. sh.append('<div class="slot" '+
  90. 'style="position:absolute;'+
  91. 'top:'+(fullyoff+y)+'px;'+
  92. 'left:'+(fulloff+x)+'px;'+
  93. 'width:'+opt.slotw+'px;'+
  94. 'height:'+opt.sloth+'px;'+
  95. 'overflow:hidden;">'+
  96. '<div class="slotslide '+mediafilter+'" data-x="'+x+'" data-y="'+y+'" '+
  97. 'style="position:absolute;'+
  98. 'top:'+(0)+'px;'+
  99. 'left:'+(0)+'px;'+
  100. 'width:'+opt.slotw+'px;'+
  101. 'height:'+opt.sloth+'px;'+
  102. 'overflow:hidden;">'+
  103. '<div style="position:absolute;'+
  104. 'top:'+(0-y)+'px;'+
  105. 'left:'+(0-x)+'px;'+
  106. 'width:'+w+'px;'+
  107. 'height:'+h+'px;'+bgstyle+';">'+
  108. '</div></div></div>');
  109. y=y+opt.sloth;
  110. if (scalestart!=undefined && rotatestart!=undefined)
  111. punchgs.TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart});
  112. }
  113. x=x+opt.slotw;
  114. }
  115. break;
  116. // SLOT ANIMATION PREPARING
  117. case "vertical":
  118. case "horizontal":
  119. if (vorh == "horizontal") {
  120. if (!visible) var off=0-opt.slotw;
  121. for (var i=0;i<opt.slots;i++) {
  122. sh.append('<div class="slot" style="position:absolute;'+
  123. 'top:'+(0+fullyoff)+'px;'+
  124. 'left:'+(fulloff+(i*opt.slotw))+'px;'+
  125. 'overflow:hidden;width:'+(opt.slotw+0.3)+'px;'+
  126. 'height:'+h+'px">'+
  127. '<div class="slotslide '+mediafilter+'" style="position:absolute;'+
  128. 'top:0px;left:'+off+'px;'+
  129. 'width:'+(opt.slotw+0.6)+'px;'+
  130. 'height:'+h+'px;overflow:hidden;">'+
  131. '<div style="position:absolute;top:0px;'+
  132. 'left:'+(0-(i*opt.slotw))+'px;'+
  133. 'width:'+w+'px;height:'+h+'px;'+bgstyle+';">'+
  134. '</div></div></div>');
  135. if (scalestart!=undefined && rotatestart!=undefined)
  136. punchgs.TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart});
  137. }
  138. } else {
  139. if (!visible) var off=0-opt.sloth;
  140. for (var i=0;i<opt.slots+2;i++) {
  141. sh.append('<div class="slot" style="position:absolute;'+
  142. 'top:'+(fullyoff+(i*opt.sloth))+'px;'+
  143. 'left:'+(fulloff)+'px;'+
  144. 'overflow:hidden;'+
  145. 'width:'+w+'px;'+
  146. 'height:'+(opt.sloth)+'px">'+
  147. '<div class="slotslide '+mediafilter+'" style="position:absolute;'+
  148. 'top:'+(off)+'px;'+
  149. 'left:0px;width:'+w+'px;'+
  150. 'height:'+opt.sloth+'px;'+
  151. 'overflow:hidden;">'+
  152. '<div style="position:absolute;'+
  153. 'top:'+(0-(i*opt.sloth))+'px;'+
  154. 'left:0px;'+
  155. 'width:'+w+'px;height:'+h+'px;'+bgstyle+';">'+
  156. '</div></div></div>');
  157. if (scalestart!=undefined && rotatestart!=undefined)
  158. punchgs.TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart});
  159. }
  160. }
  161. break;
  162. }
  163. }
  164. var getSliderTransitionParameters = function(container,comingtransition,nextsh,slidedirection) {
  165. /* Transition Name ,
  166. Transition Code,
  167. Transition Sub Code,
  168. Max Slots,
  169. MasterSpeed Delays,
  170. Preparing Slots (box,slideh, slidev),
  171. Call on nextsh (null = no, true/false for visibility first preparing),
  172. Call on actsh (null = no, true/false for visibility first preparing),
  173. Index of Animation
  174. easeIn,
  175. easeOut,
  176. speed,
  177. slots,
  178. */
  179. var opt=container[0].opt,
  180. p1i = punchgs.Power1.easeIn,
  181. p1o = punchgs.Power1.easeOut,
  182. p1io = punchgs.Power1.easeInOut,
  183. p2i = punchgs.Power2.easeIn,
  184. p2o = punchgs.Power2.easeOut,
  185. p2io = punchgs.Power2.easeInOut,
  186. p3i = punchgs.Power3.easeIn,
  187. p3o = punchgs.Power3.easeOut,
  188. p3io = punchgs.Power3.easeInOut,
  189. flatTransitions = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],
  190. premiumTransitions = [16,17,18,19,20,21,22,23,24,25,27],
  191. nexttrans =0,
  192. specials = 1,
  193. STAindex = 0,
  194. indexcounter =0,
  195. STA = new Array,
  196. transitionsArray = [ ['boxslide' , 0, 1, 10, 0,'box',false,null,0,p1o,p1o,500,6],
  197. ['boxfade', 1, 0, 10, 0,'box',false,null,1,p1io,p1io,700,5],
  198. ['slotslide-horizontal', 2, 0, 0, 200,'horizontal',true,false,2,p2io,p2io,700,3],
  199. ['slotslide-vertical', 3, 0,0,200,'vertical',true,false,3,p2io,p2io,700,3],
  200. ['curtain-1', 4, 3,0,0,'horizontal',true,true,4,p1o,p1o,300,5],
  201. ['curtain-2', 5, 3,0,0,'horizontal',true,true,5,p1o,p1o,300,5],
  202. ['curtain-3', 6, 3,25,0,'horizontal',true,true,6,p1o,p1o,300,5],
  203. ['slotzoom-horizontal', 7, 0,0,400,'horizontal',true,true,7,p1o,p1o,300,7],
  204. ['slotzoom-vertical', 8, 0,0,0,'vertical',true,true,8,p2o,p2o,500,8],
  205. ['slotfade-horizontal', 9, 0,0,1000,'horizontal',true,null,9,p2o,p2o,2000,10],
  206. ['slotfade-vertical', 10, 0,0 ,1000,'vertical',true,null,10,p2o,p2o,2000,10],
  207. ['fade', 11, 0, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  208. ['crossfade', 11, 1, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  209. ['fadethroughdark', 11, 2, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  210. ['fadethroughlight', 11, 3, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  211. ['fadethroughtransparent', 11, 4, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  212. ['slideleft', 12, 0,1,0,'horizontal',true,true,12,p3io,p3io,1000,1],
  213. ['slideup', 13, 0,1,0,'horizontal',true,true,13,p3io,p3io,1000,1],
  214. ['slidedown', 14, 0,1,0,'horizontal',true,true,14,p3io,p3io,1000,1],
  215. ['slideright', 15, 0,1,0,'horizontal',true,true,15,p3io,p3io,1000,1],
  216. ['slideoverleft', 12, 7,1,0,'horizontal',true,true,12,p3io,p3io,1000,1],
  217. ['slideoverup', 13, 7,1,0,'horizontal',true,true,13,p3io,p3io,1000,1],
  218. ['slideoverdown', 14, 7,1,0,'horizontal',true,true,14,p3io,p3io,1000,1],
  219. ['slideoverright', 15, 7,1,0,'horizontal',true,true,15,p3io,p3io,1000,1],
  220. ['slideremoveleft', 12, 8,1,0,'horizontal',true,true,12,p3io,p3io,1000,1],
  221. ['slideremoveup', 13, 8,1,0,'horizontal',true,true,13,p3io,p3io,1000,1],
  222. ['slideremovedown', 14, 8,1,0,'horizontal',true,true,14,p3io,p3io,1000,1],
  223. ['slideremoveright', 15, 8,1,0,'horizontal',true,true,15,p3io,p3io,1000,1],
  224. ['papercut', 16, 0,0,600,'',null,null,16,p3io,p3io,1000,2],
  225. ['3dcurtain-horizontal', 17, 0,20,100,'vertical',false,true,17,p1io,p1io,500,7],
  226. ['3dcurtain-vertical', 18, 0,10,100,'horizontal',false,true,18,p1io,p1io,500,5],
  227. ['cubic', 19, 0,20,600,'horizontal',false,true,19,p3io,p3io,500,1],
  228. ['cube',19,0,20,600,'horizontal',false,true,20,p3io,p3io,500,1],
  229. ['flyin', 20, 0,4,600,'vertical',false,true,21,p3o,p3io,500,1],
  230. ['turnoff', 21, 0,1,500,'horizontal',false,true,22,p3io,p3io,500,1],
  231. ['incube', 22, 0,20,200,'horizontal',false,true,23,p2io,p2io,500,1],
  232. ['cubic-horizontal', 23, 0,20,500,'vertical',false,true,24,p2o,p2o,500,1],
  233. ['cube-horizontal', 23, 0,20,500,'vertical',false,true,25,p2o,p2o,500,1],
  234. ['incube-horizontal', 24, 0,20,500,'vertical',false,true,26,p2io,p2io,500,1],
  235. ['turnoff-vertical', 25, 0,1,200,'horizontal',false,true,27,p2io,p2io,500,1],
  236. ['fadefromright', 12, 1,1,0,'horizontal',true,true,28,p2io,p2io,1000,1],
  237. ['fadefromleft', 15, 1,1,0,'horizontal',true,true,29,p2io,p2io,1000,1],
  238. ['fadefromtop', 14, 1,1,0,'horizontal',true,true,30,p2io,p2io,1000,1],
  239. ['fadefrombottom', 13, 1,1,0,'horizontal',true,true,31,p2io,p2io,1000,1],
  240. ['fadetoleftfadefromright', 12, 2,1,0,'horizontal',true,true,32,p2io,p2io,1000,1],
  241. ['fadetorightfadefromleft', 15, 2,1,0,'horizontal',true,true,33,p2io,p2io,1000,1],
  242. ['fadetobottomfadefromtop', 14, 2,1,0,'horizontal',true,true,34,p2io,p2io,1000,1],
  243. ['fadetotopfadefrombottom', 13, 2,1,0,'horizontal',true,true,35,p2io,p2io,1000,1],
  244. ['parallaxtoright', 15, 3,1,0,'horizontal',true,true,36,p2io,p2i,1500,1],
  245. ['parallaxtoleft', 12, 3,1,0,'horizontal',true,true,37,p2io,p2i,1500,1],
  246. ['parallaxtotop', 14, 3,1,0,'horizontal',true,true,38,p2io,p1i,1500,1],
  247. ['parallaxtobottom', 13, 3,1,0,'horizontal',true,true,39,p2io,p1i,1500,1],
  248. ['scaledownfromright', 12, 4,1,0,'horizontal',true,true,40,p2io,p2i,1000,1],
  249. ['scaledownfromleft', 15, 4,1,0,'horizontal',true,true,41,p2io,p2i,1000,1],
  250. ['scaledownfromtop', 14, 4,1,0,'horizontal',true,true,42,p2io,p2i,1000,1],
  251. ['scaledownfrombottom', 13, 4,1,0,'horizontal',true,true,43,p2io,p2i,1000,1],
  252. ['zoomout', 13, 5,1,0,'horizontal',true,true,44,p2io,p2i,1000,1],
  253. ['zoomin', 13, 6,1,0,'horizontal',true,true,45,p2io,p2i,1000,1],
  254. ['slidingoverlayup', 27, 0,1,0,'horizontal',true,true,47,p1io,p1o,2000,1],
  255. ['slidingoverlaydown', 28, 0,1,0,'horizontal',true,true,48,p1io,p1o,2000,1],
  256. ['slidingoverlayright', 30, 0,1,0,'horizontal',true,true,49,p1io,p1o,2000,1],
  257. ['slidingoverlayleft', 29, 0,1,0,'horizontal',true,true,50,p1io,p1o,2000,1],
  258. ['parallaxcirclesup', 31, 0,1,0,'horizontal',true,true,51,p2io,p1i,1500,1],
  259. ['parallaxcirclesdown', 32, 0,1,0,'horizontal',true,true,52,p2io,p1i,1500,1],
  260. ['parallaxcirclesright', 33, 0,1,0,'horizontal',true,true,53,p2io,p1i,1500,1],
  261. ['parallaxcirclesleft', 34, 0,1,0,'horizontal',true,true,54,p2io,p1i,1500,1],
  262. ['notransition',26,0,1,0,'horizontal',true,null,46,p2io,p2i,1000,1],
  263. ['parallaxright', 15, 3,1,0,'horizontal',true,true,55,p2io,p2i,1500,1],
  264. ['parallaxleft', 12, 3,1,0,'horizontal',true,true,56,p2io,p2i,1500,1],
  265. ['parallaxup', 14, 3,1,0,'horizontal',true,true,57,p2io,p1i,1500,1],
  266. ['parallaxdown', 13, 3,1,0,'horizontal',true,true,58,p2io,p1i,1500,1],
  267. ['grayscale', 11, 5, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  268. ['grayscalecross', 11, 6, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  269. ['brightness', 11, 7, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  270. ['brightnesscross', 11, 8, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  271. ['blurlight', 11, 9, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  272. ['blurlightcross', 11, 10, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  273. ['blurstrong', 11, 9, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1],
  274. ['blurstrongcross', 11, 10, 1 ,300,'horizontal',true,null,11,p2io,p2io,1000,1]
  275. ];
  276. opt.duringslidechange = true;
  277. // INTERNAL TEST FOR TRANSITIONS
  278. opt.testanims = false;
  279. if (opt.testanims==true) {
  280. opt.nexttesttransform = opt.nexttesttransform === undefined ? 34 : opt.nexttesttransform + 1;
  281. opt.nexttesttransform = opt.nexttesttransform>70 ? 0 : opt.nexttesttransform;
  282. comingtransition = transitionsArray[opt.nexttesttransform][0];
  283. console.log(comingtransition+" "+opt.nexttesttransform+" "+transitionsArray[opt.nexttesttransform][1]+" "+transitionsArray[opt.nexttesttransform][2]);
  284. }
  285. // CHECK AUTO DIRECTION FOR TRANSITION ARTS
  286. jQuery.each(["parallaxcircles","slidingoverlay","slide","slideover","slideremove","parallax","parralaxto"],function(i,b) {
  287. if (comingtransition==b+"horizontal") comingtransition = slidedirection!=1 ? b+"left" : b+"right";
  288. if (comingtransition==b+"vertical") comingtransition = slidedirection!=1 ? b+"up" : b+"down";
  289. });
  290. // RANDOM TRANSITIONS
  291. if (comingtransition == "random") {
  292. comingtransition = Math.round(Math.random()*transitionsArray.length-1);
  293. if (comingtransition>transitionsArray.length-1) comingtransition=transitionsArray.length-1;
  294. }
  295. // RANDOM FLAT TRANSITIONS
  296. if (comingtransition == "random-static") {
  297. comingtransition = Math.round(Math.random()*flatTransitions.length-1);
  298. if (comingtransition>flatTransitions.length-1) comingtransition=flatTransitions.length-1;
  299. comingtransition = flatTransitions[comingtransition];
  300. }
  301. // RANDOM PREMIUM TRANSITIONS
  302. if (comingtransition == "random-premium") {
  303. comingtransition = Math.round(Math.random()*premiumTransitions.length-1);
  304. if (comingtransition>premiumTransitions.length-1) comingtransition=premiumTransitions.length-1;
  305. comingtransition = premiumTransitions[comingtransition];
  306. }
  307. //joomla only change: avoid problematic transitions that don't compatible with mootools
  308. var problematicTransitions = [12,13,14,15,16,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45];
  309. if(opt.isJoomla == true && window.MooTools != undefined && problematicTransitions.indexOf(comingtransition) != -1){
  310. var newTransIndex = Math.round(Math.random() * (premiumTransitions.length-2) ) + 1;
  311. //some limits fix
  312. if (newTransIndex > premiumTransitions.length-1)
  313. newTransIndex = premiumTransitions.length-1;
  314. if(newTransIndex == 0)
  315. newTransIndex = 1;
  316. comingtransition = premiumTransitions[newTransIndex];
  317. }
  318. function findTransition() {
  319. // FIND THE RIGHT TRANSITION PARAMETERS HERE
  320. jQuery.each(transitionsArray,function(inde,trans) {
  321. if (trans[0] == comingtransition || trans[8] == comingtransition) {
  322. nexttrans = trans[1];
  323. specials = trans[2];
  324. STAindex = indexcounter;
  325. }
  326. indexcounter = indexcounter+1;
  327. })
  328. }
  329. findTransition();
  330. if (nexttrans>30) nexttrans = 30;
  331. if (nexttrans<0) nexttrans = 0;
  332. var obj = new Object();
  333. obj.nexttrans = nexttrans;
  334. obj.STA = transitionsArray[STAindex]; // PREPARED DEFAULT SETTINGS PER TRANSITION
  335. obj.specials = specials;
  336. return obj;
  337. }
  338. /*************************************
  339. - ANIMATE THE SLIDE -
  340. *************************************/
  341. var gSlideTransA = function(a,i) {
  342. if (i==undefined || jQuery.isNumeric(a)) return a;
  343. if (a==undefined) return a;
  344. return a.split(",")[i];
  345. }
  346. var animateSlideIntern = function(nexttrans, comingtransition, container, nextli, actli, nextsh, actsh, mtl) {
  347. // GET THE TRANSITION
  348. var opt = container[0].opt,
  349. ai = actli.index(),
  350. ni = nextli.index(),
  351. slidedirection = ni<ai ? 1 : 0;
  352. if (opt.sc_indicator=="arrow") slidedirection = opt.sc_indicator_dir;
  353. var stp = getSliderTransitionParameters(container,comingtransition,nextsh,slidedirection),
  354. STA = stp.STA,
  355. specials = stp.specials,
  356. nexttrans = stp.nexttrans;
  357. //KEN BURNS ONLY WITH FADE TRANSITION
  358. if (nextsh.data('kenburns')=="on") //|| actsh.data('kenburns')=="on")
  359. nexttrans = 11;
  360. // DEFINE THE MASTERSPEED FOR THE SLIDE //
  361. var ctid = nextli.data('nexttransid') || 0,
  362. masterspeed=gSlideTransA(nextli.data('masterspeed'),ctid);
  363. masterspeed = masterspeed==="default" ? STA[11] : masterspeed==="random" ? Math.round(Math.random()*1000+300) : masterspeed!=undefined ? parseInt(masterspeed,0) : STA[11];
  364. masterspeed = masterspeed > opt.delay ? opt.delay : masterspeed;
  365. // ADJUST MASTERSPEED
  366. masterspeed = masterspeed + STA[4];
  367. ///////////////////////
  368. // ADJUST SLOTS //
  369. ///////////////////////
  370. opt.slots = gSlideTransA(nextli.data('slotamount'),ctid);
  371. opt.slots = opt.slots==undefined || opt.slots=="default" ? STA[12] : opt.slots=="random" ? Math.round(Math.random()*12+4) : opt.slots;
  372. opt.slots = opt.slots < 1 ? comingtransition=="boxslide" ? Math.round(Math.random()*6+3) : comingtransition=="flyin" ? Math.round(Math.random()*4+1) : opt.slots : opt.slots;
  373. opt.slots = (nexttrans==4 || nexttrans==5 || nexttrans==6) && opt.slots<3 ? 3 : opt.slots;
  374. opt.slots = STA[3] != 0 ? Math.min(opt.slots,STA[3]) : opt.slots;
  375. opt.slots = nexttrans==9 ? opt.width/opt.slots : nexttrans==10 ? opt.height/opt.slots : opt.slots;
  376. /////////////////////////////////////////////
  377. // SET THE ACTUAL AMOUNT OF SLIDES !! //
  378. // SET A RANDOM AMOUNT OF SLOTS //
  379. ///////////////////////////////////////////
  380. opt.rotate = gSlideTransA(nextli.data('rotate'),ctid);
  381. opt.rotate = opt.rotate==undefined || opt.rotate=="default" ? 0 : opt.rotate==999 || opt.rotate=="random" ? Math.round(Math.random()*360) : opt.rotate;
  382. opt.rotate = (opt.ie || opt.ie9) ? 0 : opt.rotate;
  383. // prepareOneSlide
  384. if (nexttrans!=11) {
  385. if (STA[7] !=null) prepareOneSlide(actsh,opt,STA[7],STA[5]);
  386. if (STA[6] !=null) prepareOneSlide(nextsh,opt,STA[6],STA[5]);
  387. }
  388. // DEFAULT SETTINGS FOR NEXT AND ACT SH
  389. mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultvid'),{y:0,x:0,top:0,left:0,scale:1}),0);
  390. mtl.add(punchgs.TweenLite.set(actsh.find('.defaultvid'),{y:0,x:0,top:0,left:0,scale:1}),0);
  391. mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultvid'),{y:"+0%",x:"+0%"}),0);
  392. mtl.add(punchgs.TweenLite.set(actsh.find('.defaultvid'),{y:"+0%",x:"+0%"}),0);
  393. mtl.add(punchgs.TweenLite.set(nextsh,{autoAlpha:1,y:"+0%",x:"+0%"}),0);
  394. mtl.add(punchgs.TweenLite.set(actsh,{autoAlpha:1,y:"+0%",x:"+0%"}),0);
  395. mtl.add(punchgs.TweenLite.set(nextsh.parent(),{backgroundColor:"transparent"}),0);
  396. mtl.add(punchgs.TweenLite.set(actsh.parent(),{backgroundColor:"transparent"}),0);
  397. var ei= gSlideTransA(nextli.data('easein'),ctid),
  398. eo =gSlideTransA(nextli.data('easeout'),ctid);
  399. ei = ei==="default" ? STA[9] || punchgs.Power2.easeInOut : ei || STA[9] || punchgs.Power2.easeInOut;
  400. eo = eo==="default" ? STA[10] || punchgs.Power2.easeInOut : eo || STA[10] || punchgs.Power2.easeInOut;
  401. /////////////////////////////////////
  402. // THE SLOTSLIDE - TRANSITION I. //
  403. ////////////////////////////////////
  404. if (nexttrans==0) { // BOXSLIDE
  405. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  406. var maxz = Math.ceil(opt.height/opt.sloth);
  407. var curz = 0;
  408. nextsh.find('.slotslide').each(function(j) {
  409. var ss=jQuery(this);
  410. curz=curz+1;
  411. if (curz==maxz) curz=0;
  412. mtl.add(punchgs.TweenLite.from(ss,(masterspeed)/600,
  413. {opacity:0,top:(0-opt.sloth),left:(0-opt.slotw),rotation:opt.rotate,force3D:"auto",ease:ei}),((j*15) + ((curz)*30))/1500);
  414. });
  415. }
  416. /////////////////////////////////////
  417. // THE SLOTSLIDE - TRANSITION I. //
  418. ////////////////////////////////////
  419. if (nexttrans==1) {
  420. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  421. var maxtime,
  422. maxj = 0;
  423. nextsh.find('.slotslide').each(function(j) {
  424. var ss=jQuery(this),
  425. rand=Math.random()*masterspeed+300,
  426. rand2=Math.random()*500+200;
  427. if (rand+rand2>maxtime) {
  428. maxtime = rand2+rand2;
  429. maxj = j;
  430. }
  431. mtl.add(punchgs.TweenLite.from(ss,rand/1000,
  432. {autoAlpha:0, force3D:"auto",rotation:opt.rotate,ease:ei}),rand2/1000);
  433. });
  434. }
  435. /////////////////////////////////////
  436. // THE SLOTSLIDE - TRANSITION I. //
  437. ////////////////////////////////////
  438. if (nexttrans==2) {
  439. var subtl = new punchgs.TimelineLite();
  440. // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
  441. actsh.find('.slotslide').each(function() {
  442. var ss=jQuery(this);
  443. subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000,{left:opt.slotw,ease:ei, force3D:"auto",rotation:(0-opt.rotate)}),0);
  444. mtl.add(subtl,0);
  445. });
  446. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  447. nextsh.find('.slotslide').each(function() {
  448. var ss=jQuery(this);
  449. subtl.add(punchgs.TweenLite.from(ss,masterspeed/1000,{left:0-opt.slotw,ease:ei, force3D:"auto",rotation:opt.rotate}),0);
  450. mtl.add(subtl,0);
  451. });
  452. }
  453. /////////////////////////////////////
  454. // THE SLOTSLIDE - TRANSITION I. //
  455. ////////////////////////////////////
  456. if (nexttrans==3) {
  457. var subtl = new punchgs.TimelineLite();
  458. // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
  459. actsh.find('.slotslide').each(function() {
  460. var ss=jQuery(this);
  461. subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000,{top:opt.sloth,ease:ei,rotation:opt.rotate,force3D:"auto",transformPerspective:600}),0);
  462. mtl.add(subtl,0);
  463. });
  464. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  465. nextsh.find('.slotslide').each(function() {
  466. var ss=jQuery(this);
  467. subtl.add(punchgs.TweenLite.from(ss,masterspeed/1000,{top:0-opt.sloth,rotation:opt.rotate,ease:eo,force3D:"auto",transformPerspective:600}),0);
  468. mtl.add(subtl,0);
  469. });
  470. }
  471. /////////////////////////////////////
  472. // THE SLOTSLIDE - TRANSITION I. //
  473. ////////////////////////////////////
  474. if (nexttrans==4 || nexttrans==5) {
  475. setTimeout(function() {
  476. actsh.find('.defaultimg').css({opacity:0});
  477. },100);
  478. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  479. var cspeed = (masterspeed)/1000,
  480. ticker = cspeed,
  481. subtl = new punchgs.TimelineLite();
  482. actsh.find('.slotslide').each(function(i) {
  483. var ss=jQuery(this);
  484. var del = (i*cspeed)/opt.slots;
  485. if (nexttrans==5) del = ((opt.slots-i-1)*cspeed)/(opt.slots)/1.5;
  486. subtl.add(punchgs.TweenLite.to(ss,cspeed*3,{transformPerspective:600,force3D:"auto",top:0+opt.height,opacity:0.5,rotation:opt.rotate,ease:ei,delay:del}),0);
  487. mtl.add(subtl,0);
  488. });
  489. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  490. nextsh.find('.slotslide').each(function(i) {
  491. var ss=jQuery(this);
  492. var del = (i*cspeed)/opt.slots;
  493. if (nexttrans==5) del = ((opt.slots-i-1)*cspeed)/(opt.slots)/1.5;
  494. subtl.add(punchgs.TweenLite.from(ss,cspeed*3,
  495. {top:(0-opt.height),opacity:0.5,rotation:opt.rotate,force3D:"auto",ease:punchgs.eo,delay:del}),0);
  496. mtl.add(subtl,0);
  497. });
  498. }
  499. /////////////////////////////////////
  500. // THE SLOTSLIDE - TRANSITION I. //
  501. ////////////////////////////////////
  502. if (nexttrans==6) {
  503. if (opt.slots<2) opt.slots=2;
  504. if (opt.slots % 2) opt.slots = opt.slots+1;
  505. var subtl = new punchgs.TimelineLite();
  506. //SET DEFAULT IMG UNVISIBLE
  507. setTimeout(function() {
  508. actsh.find('.defaultimg').css({opacity:0});
  509. },100);
  510. actsh.find('.slotslide').each(function(i) {
  511. var ss=jQuery(this);
  512. if (i+1<opt.slots/2)
  513. var tempo = (i+2)*90;
  514. else
  515. var tempo = (2+opt.slots-i)*90;
  516. subtl.add(punchgs.TweenLite.to(ss,(masterspeed+tempo)/1000,{top:0+opt.height,opacity:1,force3D:"auto",rotation:opt.rotate,ease:ei}),0);
  517. mtl.add(subtl,0);
  518. });
  519. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  520. nextsh.find('.slotslide').each(function(i) {
  521. var ss=jQuery(this);
  522. if (i+1<opt.slots/2)
  523. var tempo = (i+2)*90;
  524. else
  525. var tempo = (2+opt.slots-i)*90;
  526. subtl.add(punchgs.TweenLite.from(ss,(masterspeed+tempo)/1000,
  527. {top:(0-opt.height),opacity:1,force3D:"auto",rotation:opt.rotate,ease:eo}),0);
  528. mtl.add(subtl,0);
  529. });
  530. }
  531. ////////////////////////////////////
  532. // THE SLOTSZOOM - TRANSITION II. //
  533. ////////////////////////////////////
  534. if (nexttrans==7) {
  535. masterspeed = masterspeed *2;
  536. if (masterspeed>opt.delay) masterspeed=opt.delay;
  537. var subtl = new punchgs.TimelineLite();
  538. //SET DEFAULT IMG UNVISIBLE
  539. setTimeout(function() {
  540. actsh.find('.defaultimg').css({opacity:0});
  541. },100);
  542. // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
  543. actsh.find('.slotslide').each(function() {
  544. var ss=jQuery(this).find('div');
  545. subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000,{
  546. left:(0-opt.slotw/2)+'px',
  547. top:(0-opt.height/2)+'px',
  548. width:(opt.slotw*2)+"px",
  549. height:(opt.height*2)+"px",
  550. opacity:0,
  551. rotation:opt.rotate,
  552. force3D:"auto",
  553. ease:ei}),0);
  554. mtl.add(subtl,0);
  555. });
  556. //////////////////////////////////////////////////////////////
  557. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //
  558. ///////////////////////////////////////////////////////////////
  559. nextsh.find('.slotslide').each(function(i) {
  560. var ss=jQuery(this).find('div');
  561. subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  562. {left:0,top:0,opacity:0,transformPerspective:600},
  563. {left:(0-i*opt.slotw)+'px',
  564. ease:eo,
  565. force3D:"auto",
  566. top:(0)+'px',
  567. width:opt.width,
  568. height:opt.height,
  569. opacity:1,rotation:0,
  570. delay:0.1}),0);
  571. mtl.add(subtl,0);
  572. });
  573. }
  574. ////////////////////////////////////
  575. // THE SLOTSZOOM - TRANSITION II. //
  576. ////////////////////////////////////
  577. if (nexttrans==8) {
  578. masterspeed = masterspeed * 3;
  579. if (masterspeed>opt.delay) masterspeed=opt.delay;
  580. var subtl = new punchgs.TimelineLite();
  581. // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
  582. actsh.find('.slotslide').each(function() {
  583. var ss=jQuery(this).find('div');
  584. subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000,
  585. {left:(0-opt.width/2)+'px',
  586. top:(0-opt.sloth/2)+'px',
  587. width:(opt.width*2)+"px",
  588. height:(opt.sloth*2)+"px",
  589. force3D:"auto",
  590. ease:ei,
  591. opacity:0,rotation:opt.rotate}),0);
  592. mtl.add(subtl,0);
  593. });
  594. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //
  595. ///////////////////////////////////////////////////////////////
  596. nextsh.find('.slotslide').each(function(i) {
  597. var ss=jQuery(this).find('div');
  598. subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  599. {left:0, top:0,opacity:0,force3D:"auto"},
  600. {'left':(0)+'px',
  601. 'top':(0-i*opt.sloth)+'px',
  602. 'width':(nextsh.find('.defaultimg').data('neww'))+"px",
  603. 'height':(nextsh.find('.defaultimg').data('newh'))+"px",
  604. opacity:1,
  605. ease:eo,rotation:0,
  606. }),0);
  607. mtl.add(subtl,0);
  608. });
  609. }
  610. ////////////////////////////////////////
  611. // THE SLOTSFADE - TRANSITION III. //
  612. //////////////////////////////////////
  613. if (nexttrans==9 || nexttrans==10) {
  614. var ssamount=0;
  615. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  616. nextsh.find('.slotslide').each(function(i) {
  617. var ss=jQuery(this);
  618. ssamount++;
  619. mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/2000,{autoAlpha:0,force3D:"auto",transformPerspective:600},
  620. {autoAlpha:1,ease:ei,delay:(i*opt.slots/100)/2000}),0);
  621. });
  622. }
  623. //////////////////////
  624. // SLIDING OVERLAYS //
  625. //////////////////////
  626. if (nexttrans==27||nexttrans==28||nexttrans==29||nexttrans==30) {
  627. var slot = nextsh.find('.slot'),
  628. nd = nexttrans==27 || nexttrans==28 ? 1 : 2,
  629. mhp = nexttrans==27 || nexttrans==29 ? "-100%" : "+100%",
  630. php = nexttrans==27 || nexttrans==29 ? "+100%" : "-100%",
  631. mep = nexttrans==27 || nexttrans==29 ? "-80%" : "80%",
  632. pep = nexttrans==27 || nexttrans==29 ? "+80%" : "-80%",
  633. ptp = nexttrans==27 || nexttrans==29 ? "+10%" : "-10%",
  634. fa = {overwrite:"all"},
  635. ta = {autoAlpha:0,zIndex:1,force3D:"auto",ease:ei},
  636. fb = {position:"inherit",autoAlpha:0,overwrite:"all",zIndex:1},
  637. tb = {autoAlpha:1,force3D:"auto",ease:eo},
  638. fc = {overwrite:"all",zIndex:2,opacity:1,autoAlpha:1},
  639. tc = {autoAlpha:1,force3D:"auto",overwrite:"all",ease:ei},
  640. fd = {overwrite:"all",zIndex:2,autoAlpha:1},
  641. td = {autoAlpha:1,force3D:"auto",ease:ei},
  642. at = nd==1 ? "y" : "x";
  643. fa[at] = "0px";
  644. ta[at] = mhp;
  645. fb[at] = ptp;
  646. tb[at] = "0%";
  647. fc[at] = php;
  648. tc[at] = mhp;
  649. fd[at] = mep;
  650. td[at] = pep;
  651. slot.append('<span style="background-color:rgba(0,0,0,0.6);width:100%;height:100%;position:absolute;top:0px;left:0px;display:block;z-index:2"></span>');
  652. mtl.add(punchgs.TweenLite.fromTo(actsh,masterspeed/1000,fa,ta),0);
  653. mtl.add(punchgs.TweenLite.fromTo(nextsh.find('.defaultimg'),masterspeed/2000,fb,tb),masterspeed/2000);
  654. mtl.add(punchgs.TweenLite.fromTo(slot,masterspeed/1000,fc,tc),0);
  655. mtl.add(punchgs.TweenLite.fromTo(slot.find('.slotslide div'),masterspeed/1000,fd,td),0);
  656. }
  657. ////////////////////////////////
  658. // PARALLAX CIRCLE TRANSITION //
  659. ////////////////////////////////
  660. //nexttrans = 34;
  661. if (nexttrans==31||nexttrans==32||nexttrans==33||nexttrans==34) { // up , down, right ,left
  662. masterspeed = 6000;
  663. ei = punchgs.Power3.easeInOut;
  664. var ms = masterspeed / 1000;
  665. mas = ms - ms/5,
  666. _nt = nexttrans,
  667. fy = _nt == 31 ? "+100%" : _nt == 32 ? "-100%" : "0%",
  668. fx = _nt == 33 ? "+100%" : _nt == 34 ? "-100%" : "0%",
  669. ty = _nt == 31 ? "-100%" : _nt == 32 ? "+100%" : "0%",
  670. tx = _nt == 33 ? "-100%" : _nt == 34 ? "+100%" : "0%",
  671. mtl.add(punchgs.TweenLite.fromTo(actsh,ms-(ms*0.2),{y:0,x:0},{y:ty,x:tx,ease:eo}),ms*0.2);
  672. mtl.add(punchgs.TweenLite.fromTo(nextsh,ms,{y:fy, x:fx},{y:"0%",x:"0%",ease:ei}),0);
  673. //mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{autoAlpha:0}),0);border:1px solid #fff
  674. function moveCircles(cont,ms,_nt,dir,ei) {
  675. var slot = cont.find('.slot'),
  676. pieces = 6,
  677. sizearray = [2,1.2,0.9,0.7,0.55,0.42],
  678. sw = cont.width(),
  679. sh = cont.height(),
  680. di = sh>sw ? (sw*2) / pieces : (sh*2) / pieces;
  681. slot.wrap('<div class="slot-circle-wrapper" style="overflow:hidden;position:absolute;border:1px solid #fff"></div>');
  682. for (var i=0; i<pieces;i++) slot.parent().clone(false).appendTo(nextsh);
  683. cont.find('.slot-circle-wrapper').each(function(i) {
  684. if (i<pieces) {
  685. var t = jQuery(this),
  686. s = t.find('.slot'),
  687. nh = sw>sh ? sizearray[i]*sw : sizearray[i]*sh,
  688. nw = nh,
  689. nl = 0 + (nw/2 - sw/2),
  690. nt = 0 + (nh/2 - sh/2),
  691. br = i!=0 ? "50%" : "0",
  692. ftop = _nt == 31 ? sh/2 - nh/2 : _nt == 32 ? sh/2 - nh/2 : sh/2 - nh/2,
  693. fleft = _nt == 33 ? sw/2 - nw/2 : _nt == 34 ? sw - nw : sw/2 - nw/2,
  694. fa = {scale:1,transformOrigo:"50% 50%",width:nw+"px",height:nh+"px",top:ftop+"px",left:fleft+"px",borderRadius:br},
  695. ta = {scale:1,top:sh/2 - nh/2,left:sw/2 - nw/2,ease:ei},
  696. fftop = _nt == 31 ? nt : _nt == 32 ? nt : nt,
  697. ffleft = _nt == 33 ? nl : _nt == 34 ? nl+(sw/2) : nl,
  698. fb = {width:sw,height:sh,autoAlpha:1,top:fftop+"px",position:"absolute",left:ffleft+"px"},
  699. tb = {top:nt+"px",left:nl+"px",ease:ei},
  700. speed = ms,
  701. delay = 0;
  702. mtl.add(punchgs.TweenLite.fromTo(t,speed,fa,ta),delay);
  703. mtl.add(punchgs.TweenLite.fromTo(s,speed,fb,tb),delay);
  704. mtl.add(punchgs.TweenLite.fromTo(t,0.001,{autoAlpha:0},{autoAlpha:1}),0);
  705. }
  706. })
  707. }
  708. nextsh.find('.slot').remove();
  709. nextsh.find('.defaultimg').clone().appendTo(nextsh).addClass("slot");
  710. moveCircles(nextsh, ms,_nt,"in",ei);
  711. // moveCircles(actsh, mas,_nt,"out",eo);
  712. }
  713. /////////////////////////////
  714. // SIMPLE FADE ANIMATIONS //
  715. ////////////////////////////
  716. if (nexttrans==11) {
  717. if (specials>12) specials = 0;
  718. var ssamount=0,
  719. bgcol = specials == 2 ? "#000000" : specials == 3 ? "#ffffff" : "transparent";
  720. switch (specials) {
  721. case 0: //FADE
  722. mtl.add(punchgs.TweenLite.fromTo(nextsh,masterspeed/1000,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:ei}),0);
  723. break;
  724. case 1: // CROSSFADE
  725. mtl.add(punchgs.TweenLite.fromTo(nextsh,masterspeed/1000,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:ei}),0);
  726. mtl.add(punchgs.TweenLite.fromTo(actsh,masterspeed/1000,{autoAlpha:1},{autoAlpha:0,force3D:"auto",ease:ei}),0);
  727. break;
  728. case 2:
  729. case 3:
  730. case 4:
  731. mtl.add(punchgs.TweenLite.set(actsh.parent(),{backgroundColor:bgcol,force3D:"auto"}),0);
  732. mtl.add(punchgs.TweenLite.set(nextsh.parent(),{backgroundColor:"transparent",force3D:"auto"}),0);
  733. mtl.add(punchgs.TweenLite.to(actsh,masterspeed/2000,{autoAlpha:0,force3D:"auto",ease:ei}),0);
  734. mtl.add(punchgs.TweenLite.fromTo(nextsh,masterspeed/2000,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:ei}),masterspeed/2000);
  735. break;
  736. case 5: // GRAYSCALE
  737. case 6: // GRAYSCALECROSS
  738. case 7: // BRIGHTNESS
  739. case 8: // BRIGHTNESSCROSS
  740. case 9: // BLUR LIGHT
  741. case 10: // BLUR LIGHT CROSS
  742. case 11: // BLUR STRONG
  743. case 12: // BLUR STRONG CROSS
  744. var _blur = jQuery.inArray(specials,[9,10])>=0 ? 5 : jQuery.inArray(specials,[11,12])>=0 ? 10 : 0,
  745. _gray = jQuery.inArray(specials,[5,6,7,8])>=0 ? 100 : 0,
  746. _bright = jQuery.inArray(specials,[7,8])>=0 ? 300 : 0,
  747. __ff = "blur("+_blur+"px) grayscale("+_gray+"%) brightness("+_bright+"%)",
  748. __ft = "blur(0px) grayscale(0%) brightness(100%)";
  749. mtl.add(punchgs.TweenLite.fromTo(nextsh,masterspeed/1000,{autoAlpha:0,filter:__ff, "-webkit-filter":__ff},{autoAlpha:1,filter:__ft, "-webkit-filter":__ft,force3D:"auto",ease:ei}),0);
  750. if (jQuery.inArray(specials,[6,8,10])>=0)
  751. mtl.add(punchgs.TweenLite.fromTo(actsh,masterspeed/1000,{autoAlpha:1,filter:__ft, "-webkit-filter":__ft},{autoAlpha:0,force3D:"auto",ease:ei,filter:__ff, "-webkit-filter":__ff}),0);
  752. break;
  753. }
  754. mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{autoAlpha:1}),0);
  755. mtl.add(punchgs.TweenLite.set(actsh.find('defaultimg'),{autoAlpha:1}),0);
  756. }
  757. if (nexttrans==26) {
  758. var ssamount=0;
  759. masterspeed=0;
  760. mtl.add(punchgs.TweenLite.fromTo(nextsh,masterspeed/1000,{autoAlpha:0},{autoAlpha:1,force3D:"auto",ease:ei}),0);
  761. mtl.add(punchgs.TweenLite.to(actsh,masterspeed/1000,{autoAlpha:0,force3D:"auto",ease:ei}),0);
  762. mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{autoAlpha:1}),0);
  763. mtl.add(punchgs.TweenLite.set(actsh.find('defaultimg'),{autoAlpha:1}),0);
  764. }
  765. if (nexttrans==12 || nexttrans==13 || nexttrans==14 || nexttrans==15) {
  766. masterspeed = masterspeed;
  767. if (masterspeed>opt.delay) masterspeed=opt.delay;
  768. //masterspeed = 1000;
  769. setTimeout(function() {
  770. punchgs.TweenLite.set(actsh.find('.defaultimg'),{autoAlpha:0});
  771. },100);
  772. var oow = opt.width,
  773. ooh = opt.height,
  774. ssn=nextsh.find('.slotslide, .defaultvid'),
  775. twx = 0,
  776. twy = 0,
  777. op = 1,
  778. scal = 1,
  779. fromscale = 1,
  780. speedy = masterspeed/1000,
  781. speedy2 = speedy;
  782. if (opt.sliderLayout=="fullwidth" || opt.sliderLayout=="fullscreen") {
  783. oow=ssn.width();
  784. ooh=ssn.height();
  785. }
  786. if (nexttrans==12)
  787. twx = oow;
  788. else
  789. if (nexttrans==15)
  790. twx = 0-oow;
  791. else
  792. if (nexttrans==13)
  793. twy = ooh;
  794. else
  795. if (nexttrans==14)
  796. twy = 0-ooh;
  797. // DEPENDING ON EXTENDED SPECIALS, DIFFERENT SCALE AND OPACITY FUNCTIONS NEED TO BE ADDED
  798. if (specials == 1) op = 0;
  799. if (specials == 2) op = 0;
  800. if (specials == 3) speedy = masterspeed / 1300;
  801. if (specials==4 || specials==5)
  802. scal=0.6;
  803. if (specials==6 )
  804. scal=1.4;
  805. if (specials==5 || specials==6) {
  806. fromscale=1.4;
  807. op=0;
  808. oow=0;
  809. ooh=0;twx=0;twy=0;
  810. }
  811. if (specials==6) fromscale=0.6;
  812. var dd = 0;
  813. if (specials==7) {
  814. oow = 0;
  815. ooh = 0;
  816. }
  817. var inc = nextsh.find('.slotslide'),
  818. outc = actsh.find('.slotslide, .defaultvid');
  819. mtl.add(punchgs.TweenLite.set(actli,{zIndex:15}),0);
  820. mtl.add(punchgs.TweenLite.set(nextli,{zIndex:20}),0);
  821. if (specials==8) {
  822. mtl.add(punchgs.TweenLite.set(actli,{zIndex:20}),0);
  823. mtl.add(punchgs.TweenLite.set(nextli,{zIndex:15}),0);
  824. mtl.add(punchgs.TweenLite.set(inc,{left:0, top:0, scale:1, opacity:1,rotation:0,ease:ei,force3D:"auto"}),0);
  825. } else {
  826. mtl.add(punchgs.TweenLite.from(inc,speedy,{left:twx, top:twy, scale:fromscale, opacity:op,rotation:opt.rotate,ease:ei,force3D:"auto"}),0);
  827. }
  828. if (specials==4 || specials==5) {
  829. oow = 0; ooh=0;
  830. }
  831. if (specials!=1)
  832. switch (nexttrans) {
  833. case 12:
  834. mtl.add(punchgs.TweenLite.to(outc,speedy2,{'left':(0-oow)+'px',force3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:eo}),0);
  835. break;
  836. case 15:
  837. mtl.add(punchgs.TweenLite.to(outc,speedy2,{'left':(oow)+'px',force3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:eo}),0);
  838. break;
  839. case 13:
  840. mtl.add(punchgs.TweenLite.to(outc,speedy2,{'top':(0-ooh)+'px',force3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:eo}),0);
  841. break;
  842. case 14:
  843. mtl.add(punchgs.TweenLite.to(outc,speedy2,{'top':(ooh)+'px',force3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:eo}),0);
  844. break;
  845. }
  846. }
  847. //////////////////////////////////////
  848. // THE SLOTSLIDE - TRANSITION XVI. //
  849. //////////////////////////////////////
  850. if (nexttrans==16) { // PAPERCUT
  851. var subtl = new punchgs.TimelineLite();
  852. mtl.add(punchgs.TweenLite.set(actli,{'position':'absolute','z-index':20}),0);
  853. mtl.add(punchgs.TweenLite.set(nextli,{'position':'absolute','z-index':15}),0);
  854. // PREPARE THE CUTS
  855. actli.wrapInner('<div class="tp-half-one" style="position:relative; width:100%;height:100%"></div>');
  856. actli.find('.tp-half-one').clone(true).appendTo(actli).addClass("tp-half-two");
  857. actli.find('.tp-half-two').removeClass('tp-half-one');
  858. var oow = opt.width,
  859. ooh = opt.height;
  860. if (opt.autoHeight=="on")
  861. ooh = container.height();
  862. actli.find('.tp-half-one .defaultimg').wrap('<div class="tp-papercut" style="width:'+oow+'px;height:'+ooh+'px;"></div>')
  863. actli.find('.tp-half-two .defaultimg').wrap('<div class="tp-papercut" style="width:'+oow+'px;height:'+ooh+'px;"></div>')
  864. actli.find('.tp-half-two .defaultimg').css({position:'absolute',top:'-50%'});
  865. actli.find('.tp-half-two .tp-caption').wrapAll('<div style="position:absolute;top:-50%;left:0px;"></div>');
  866. mtl.add(punchgs.TweenLite.set(actli.find('.tp-half-two'),
  867. {width:oow,height:ooh,overflow:'hidden',zIndex:15,position:'absolute',top:ooh/2,left:'0px',transformPerspective:600,transformOrigin:"center bottom"}),0);
  868. mtl.add(punchgs.TweenLite.set(actli.find('.tp-half-one'),
  869. {width:oow,height:ooh/2,overflow:'visible',zIndex:10,position:'absolute',top:'0px',left:'0px',transformPerspective:600,transformOrigin:"center top"}),0);
  870. // ANIMATE THE CUTS
  871. var img=actli.find('.defaultimg'),
  872. ro1=Math.round(Math.random()*20-10),
  873. ro2=Math.round(Math.random()*20-10),
  874. ro3=Math.round(Math.random()*20-10),
  875. xof = Math.random()*0.4-0.2,
  876. yof = Math.random()*0.4-0.2,
  877. sc1=Math.random()*1+1,
  878. sc2=Math.random()*1+1,
  879. sc3=Math.random()*0.3+0.3;
  880. mtl.add(punchgs.TweenLite.set(actli.find('.tp-half-one'),{overflow:'hidden'}),0);
  881. mtl.add(punchgs.TweenLite.fromTo(actli.find('.tp-half-one'),masterspeed/800,
  882. {width:oow,height:ooh/2,position:'absolute',top:'0px',left:'0px',force3D:"auto",transformOrigin:"center top"},
  883. {scale:sc1,rotation:ro1,y:(0-ooh-ooh/4),autoAlpha:0,ease:ei}),0);
  884. mtl.add(punchgs.TweenLite.fromTo(actli.find('.tp-half-two'),masterspeed/800,
  885. {width:oow,height:ooh,overflow:'hidden',position:'absolute',top:ooh/2,left:'0px',force3D:"auto",transformOrigin:"center bottom"},
  886. {scale:sc2,rotation:ro2,y:ooh+ooh/4,ease:ei,autoAlpha:0,onComplete:function() {
  887. // CLEAN UP
  888. punchgs.TweenLite.set(actli,{'position':'absolute','z-index':15});
  889. punchgs.TweenLite.set(nextli,{'position':'absolute','z-index':20});
  890. if (actli.find('.tp-half-one').length>0) {
  891. actli.find('.tp-half-one .defaultimg').unwrap();
  892. actli.find('.tp-half-one .slotholder').unwrap();
  893. }
  894. actli.find('.tp-half-two').remove();
  895. }}),0);
  896. subtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{autoAlpha:1}),0);
  897. if (actli.html()!=null)
  898. mtl.add(punchgs.TweenLite.fromTo(nextli,(masterspeed-200)/1000,
  899. {scale:sc3,x:(opt.width/4)*xof, y:(ooh/4)*yof,rotation:ro3,force3D:"auto",transformOrigin:"center center",ease:eo},
  900. {autoAlpha:1,scale:1,x:0,y:0,rotation:0}),0);
  901. mtl.add(subtl,0);
  902. }
  903. ////////////////////////////////////////
  904. // THE SLOTSLIDE - TRANSITION XVII. //
  905. ///////////////////////////////////////
  906. if (nexttrans==17) { // 3D CURTAIN HORIZONTAL
  907. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  908. nextsh.find('.slotslide').each(function(j) {
  909. var ss=jQuery(this);
  910. mtl.add(punchgs.TweenLite.fromTo(ss,(masterspeed)/800,
  911. {opacity:0,rotationY:0,scale:0.9,rotationX:-110,force3D:"auto",transformPerspective:600,transformOrigin:"center center"},
  912. {opacity:1,top:0,left:0,scale:1,rotation:0,rotationX:0,force3D:"auto",rotationY:0,ease:ei,delay:j*0.06}),0);
  913. });
  914. }
  915. ////////////////////////////////////////
  916. // THE SLOTSLIDE - TRANSITION XVIII. //
  917. ///////////////////////////////////////
  918. if (nexttrans==18) { // 3D CURTAIN VERTICAL
  919. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  920. nextsh.find('.slotslide').each(function(j) {
  921. var ss=jQuery(this);
  922. mtl.add(punchgs.TweenLite.fromTo(ss,(masterspeed)/500,
  923. {autoAlpha:0,rotationY:110,scale:0.9,rotationX:10,force3D:"auto",transformPerspective:600,transformOrigin:"center center"},
  924. {autoAlpha:1,top:0,left:0,scale:1,rotation:0,rotationX:0,force3D:"auto",rotationY:0,ease:ei,delay:j*0.06}),0);
  925. });
  926. }
  927. ////////////////////////////////////////
  928. // THE SLOTSLIDE - TRANSITION XIX. //
  929. ///////////////////////////////////////
  930. if (nexttrans==19 || nexttrans==22) { // IN CUBE
  931. var subtl = new punchgs.TimelineLite();
  932. //SET DEFAULT IMG UNVISIBLE
  933. mtl.add(punchgs.TweenLite.set(actli,{zIndex:20}),0);
  934. mtl.add(punchgs.TweenLite.set(nextli,{zIndex:20}),0);
  935. setTimeout(function() {
  936. actsh.find('.defaultimg').css({opacity:0});
  937. },100);
  938. var rot = 90,
  939. op = 1,
  940. torig ="center center ";
  941. if (slidedirection==1) rot = -90;
  942. if (nexttrans==19) {
  943. torig = torig+"-"+opt.height/2;
  944. op=0;
  945. } else {
  946. torig = torig+opt.height/2;
  947. }
  948. // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
  949. punchgs.TweenLite.set(container,{transformStyle:"flat",backfaceVisibility:"hidden",transformPerspective:600});
  950. nextsh.find('.slotslide').each(function(j) {
  951. var ss=jQuery(this);
  952. subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  953. {transformStyle:"flat",backfaceVisibility:"hidden",left:0,rotationY:opt.rotate,z:10,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig,rotationX:rot},
  954. {left:0,rotationY:0,top:0,z:0, scale:1,force3D:"auto",rotationX:0, delay:(j*50)/1000,ease:ei}),0);
  955. subtl.add(punchgs.TweenLite.to(ss,0.1,{autoAlpha:1,delay:(j*50)/1000}),0);
  956. mtl.add(subtl);
  957. });
  958. actsh.find('.slotslide').each(function(j) {
  959. var ss=jQuery(this);
  960. var rot = -90;
  961. if (slidedirection==1) rot = 90;
  962. subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  963. {transformStyle:"flat",backfaceVisibility:"hidden",autoAlpha:1,rotationY:0,top:0,z:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig, rotationX:0},
  964. {autoAlpha:1,rotationY:opt.rotate,top:0,z:10, scale:1,rotationX:rot, delay:(j*50)/1000,force3D:"auto",ease:eo}),0);
  965. mtl.add(subtl);
  966. });
  967. mtl.add(punchgs.TweenLite.set(actli,{zIndex:18}),0);
  968. }
  969. ////////////////////////////////////////
  970. // THE SLOTSLIDE - TRANSITION XX. //
  971. ///////////////////////////////////////
  972. if (nexttrans==20 ) { // FLYIN
  973. setTimeout(function() {
  974. actsh.find('.defaultimg').css({opacity:0});
  975. },100);
  976. if (slidedirection==1) {
  977. var ofx = -opt.width
  978. var rot =80;
  979. var torig = "20% 70% -"+opt.height/2;
  980. } else {
  981. var ofx = opt.width;
  982. var rot = -80;
  983. var torig = "80% 70% -"+opt.height/2;
  984. }
  985. nextsh.find('.slotslide').each(function(j) {
  986. var ss=jQuery(this),
  987. d = (j*50)/1000;
  988. mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  989. {left:ofx,rotationX:40,z:-600, opacity:op,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig,transformStyle:"flat",rotationY:rot},
  990. {left:0,rotationX:0,opacity:1,top:0,z:0, scale:1,rotationY:0, delay:d,ease:ei}),0);
  991. });
  992. actsh.find('.slotslide').each(function(j) {
  993. var ss=jQuery(this),
  994. d = (j*50)/1000;
  995. d = j>0 ? d + masterspeed/9000 : 0;
  996. if (slidedirection!=1) {
  997. var ofx = -opt.width/2
  998. var rot =30;
  999. var torig = "20% 70% -"+opt.height/2;
  1000. } else {
  1001. var ofx = opt.width/2;
  1002. var rot = -30;
  1003. var torig = "80% 70% -"+opt.height/2;
  1004. }
  1005. eo=punchgs.Power2.easeInOut;
  1006. mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  1007. {opacity:1,rotationX:0,top:0,z:0,scale:1,left:0, force3D:"auto",transformPerspective:600,transformOrigin:torig, transformStyle:"flat",rotationY:0},
  1008. {opacity:1,rotationX:20,top:0, z:-600, left:ofx, force3D:"auto",rotationY:rot, delay:d,ease:eo}),0);
  1009. });
  1010. }
  1011. ////////////////////////////////////////
  1012. // THE SLOTSLIDE - TRANSITION XX. //
  1013. ///////////////////////////////////////
  1014. if (nexttrans==21 || nexttrans==25) { // TURNOFF
  1015. //SET DEFAULT IMG UNVISIBLE
  1016. setTimeout(function() {
  1017. actsh.find('.defaultimg').css({opacity:0});
  1018. },100);
  1019. var rot = 90,
  1020. ofx = -opt.width,
  1021. rot2 = -rot;
  1022. if (slidedirection==1) {
  1023. if (nexttrans==25) {
  1024. var torig = "center top 0";
  1025. rot = opt.rotate;
  1026. } else {
  1027. var torig = "left center 0";
  1028. rot2 = opt.rotate;
  1029. }
  1030. } else {
  1031. ofx = opt.width;
  1032. rot = -90;
  1033. if (nexttrans==25) {
  1034. var torig = "center bottom 0"
  1035. rot2 = -rot;
  1036. rot = opt.rotate;
  1037. } else {
  1038. var torig = "right center 0";
  1039. rot2 = opt.rotate;
  1040. }
  1041. }
  1042. nextsh.find('.slotslide').each(function(j) {
  1043. var ss=jQuery(this),
  1044. ms2 = ((masterspeed/1.5)/3);
  1045. mtl.add(punchgs.TweenLite.fromTo(ss,(ms2*2)/1000,
  1046. {left:0,transformStyle:"flat",rotationX:rot2,z:0, autoAlpha:0,top:0,scale:1,force3D:"auto",transformPerspective:1200,transformOrigin:torig,rotationY:rot},
  1047. {left:0,rotationX:0,top:0,z:0, autoAlpha:1,scale:1,rotationY:0,force3D:"auto",delay:ms2/1000, ease:ei}),0);
  1048. });
  1049. if (slidedirection!=1) {
  1050. ofx = -opt.width
  1051. rot = 90;
  1052. if (nexttrans==25) {
  1053. torig = "center top 0"
  1054. rot2 = -rot;
  1055. rot = opt.rotate;
  1056. } else {
  1057. torig = "left center 0";
  1058. rot2 = opt.rotate;
  1059. }
  1060. } else {
  1061. ofx = opt.width;
  1062. rot = -90;
  1063. if (nexttrans==25) {
  1064. torig = "center bottom 0"
  1065. rot2 = -rot;
  1066. rot = opt.rotate;
  1067. } else {
  1068. torig = "right center 0";
  1069. rot2 = opt.rotate;
  1070. }
  1071. }
  1072. actsh.find('.slotslide').each(function(j) {
  1073. var ss=jQuery(this);
  1074. mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  1075. {left:0,transformStyle:"flat",rotationX:0,z:0, autoAlpha:1,top:0,scale:1,force3D:"auto",transformPerspective:1200,transformOrigin:torig,rotationY:0},
  1076. {left:0,rotationX:rot2,top:0,z:0,autoAlpha:1,force3D:"auto", scale:1,rotationY:rot,ease:eo}),0);
  1077. });
  1078. }
  1079. ////////////////////////////////////////
  1080. // THE SLOTSLIDE - TRANSITION XX. //
  1081. ///////////////////////////////////////
  1082. if (nexttrans==23 || nexttrans == 24) { // cube-horizontal - inboxhorizontal
  1083. //SET DEFAULT IMG UNVISIBLE
  1084. setTimeout(function() {
  1085. actsh.find('.defaultimg').css({opacity:0});
  1086. },100);
  1087. var rot = -90,
  1088. op = 1,
  1089. opx=0;
  1090. if (slidedirection==1) rot = 90;
  1091. if (nexttrans==23) {
  1092. var torig = "center center -"+opt.width/2;
  1093. op=0;
  1094. } else
  1095. var torig = "center center "+opt.width/2;
  1096. punchgs.TweenLite.set(container,{transformStyle:"preserve-3d",backfaceVisibility:"hidden",perspective:2500});
  1097. nextsh.find('.slotslide').each(function(j) {
  1098. var ss=jQuery(this);
  1099. mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  1100. {left:opx,rotationX:opt.rotate,force3D:"auto",opacity:op,top:0,scale:1,transformPerspective:1200,transformOrigin:torig,rotationY:rot},
  1101. {left:0,rotationX:0,autoAlpha:1,top:0,z:0, scale:1,rotationY:0, delay:(j*50)/500,ease:ei}),0);
  1102. });
  1103. rot = 90;
  1104. if (slidedirection==1) rot = -90;
  1105. actsh.find('.slotslide').each(function(j) {
  1106. var ss=jQuery(this);
  1107. mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,
  1108. {left:0,rotationX:0,top:0,z:0,scale:1,force3D:"auto",transformStyle:"flat",transformPerspective:1200,transformOrigin:torig, rotationY:0},
  1109. {left:opx,rotationX:opt.rotate,top:0, scale:1,rotationY:rot, delay:(j*50)/500,ease:eo}),0);
  1110. if (nexttrans==23) mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/2000,{autoAlpha:1},{autoAlpha:0,delay:(j*50)/500 + masterspeed/3000,ease:eo}),0);
  1111. });
  1112. }
  1113. return mtl;
  1114. }
  1115. })(jQuery);