owl.carousel.min.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. /*
  2. * jQuery OwlCarousel v1.29
  3. *
  4. * Copyright (c) 2013 Bartosz Wojciechowski
  5. * http://www.owlgraphic.com/owlcarousel
  6. *
  7. * Licensed under MIT
  8. *
  9. */
  10. if (typeof Object.create !== "function") {
  11. Object.create = function (e) {
  12. function t() {}
  13. t.prototype = e;
  14. return new t
  15. }
  16. }(function (e, t, n, r) {
  17. var i = {
  18. init: function (t, n) {
  19. var r = this;
  20. r.$elem = e(n);
  21. r.options = e.extend({}, e.fn.owlCarousel.options, r.$elem.data(), t);
  22. r.userOptions = t;
  23. r.loadContent()
  24. },
  25. loadContent: function () {
  26. var t = this;
  27. if (typeof t.options.beforeInit === "function") {
  28. t.options.beforeInit.apply(this, [t.$elem])
  29. }
  30. if (typeof t.options.jsonPath === "string") {
  31. var n = t.options.jsonPath;
  32. function r(e) {
  33. if (typeof t.options.jsonSuccess === "function") {
  34. t.options.jsonSuccess.apply(this, [e])
  35. } else {
  36. var n = "";
  37. for (var r in e["owl"]) {
  38. n += e["owl"][r]["item"]
  39. }
  40. t.$elem.html(n)
  41. }
  42. t.logIn()
  43. }
  44. e.getJSON(n, r)
  45. } else {
  46. t.logIn()
  47. }
  48. },
  49. logIn: function (e) {
  50. var t = this;
  51. t.$elem.css({
  52. opacity: 0
  53. });
  54. t.orignalItems = t.options.items;
  55. t.checkBrowser();
  56. t.wrapperWidth = 0;
  57. t.checkVisible;
  58. t.setVars()
  59. },
  60. setVars: function () {
  61. var e = this;
  62. if (e.$elem.children().length === 0) {
  63. return false
  64. }
  65. e.baseClass();
  66. e.eventTypes();
  67. e.$userItems = e.$elem.children();
  68. e.itemsAmount = e.$userItems.length;
  69. e.wrapItems();
  70. e.$owlItems = e.$elem.find(".owl-item");
  71. e.$owlWrapper = e.$elem.find(".owl-wrapper");
  72. e.playDirection = "next";
  73. e.prevItem = 0;
  74. e.currentItem = 0;
  75. e.customEvents();
  76. e.onStartup()
  77. },
  78. onStartup: function () {
  79. var e = this;
  80. e.updateItems();
  81. e.calculateAll();
  82. e.buildControls();
  83. e.updateControls();
  84. e.response();
  85. e.moveEvents();
  86. e.stopOnHover();
  87. e.owlStatus();
  88. if (e.options.transitionStyle !== false) {
  89. e.transitionTypes(e.options.transitionStyle)
  90. }
  91. if (e.options.autoPlay === true) {
  92. e.options.autoPlay = 5e3
  93. }
  94. e.play();
  95. e.$elem.find(".owl-wrapper").css("display", "block");
  96. if (!e.$elem.is(":visible")) {
  97. e.watchVisibility()
  98. } else {
  99. e.$elem.css("opacity", 1)
  100. }
  101. e.onstartup = false;
  102. e.eachMoveUpdate();
  103. if (typeof e.options.afterInit === "function") {
  104. e.options.afterInit.apply(this, [e.$elem])
  105. }
  106. },
  107. eachMoveUpdate: function () {
  108. var e = this;
  109. if (e.options.lazyLoad === true) {
  110. e.lazyLoad()
  111. }
  112. if (e.options.autoHeight === true) {
  113. e.autoHeight()
  114. }
  115. e.onVisibleItems();
  116. if (typeof e.options.afterAction === "function") {
  117. e.options.afterAction.apply(this, [e.$elem])
  118. }
  119. },
  120. updateVars: function () {
  121. var e = this;
  122. if (typeof e.options.beforeUpdate === "function") {
  123. e.options.beforeUpdate.apply(this, [e.$elem])
  124. }
  125. e.watchVisibility();
  126. e.updateItems();
  127. e.calculateAll();
  128. e.updatePosition();
  129. e.updateControls();
  130. e.eachMoveUpdate();
  131. if (typeof e.options.afterUpdate === "function") {
  132. e.options.afterUpdate.apply(this, [e.$elem])
  133. }
  134. },
  135. reload: function (e) {
  136. var t = this;
  137. setTimeout(function () {
  138. t.updateVars()
  139. }, 0)
  140. },
  141. watchVisibility: function () {
  142. var e = this;
  143. if (e.$elem.is(":visible") === false) {
  144. e.$elem.css({
  145. opacity: 0
  146. });
  147. clearInterval(e.autoPlayInterval);
  148. clearInterval(e.checkVisible)
  149. } else {
  150. return false
  151. }
  152. e.checkVisible = setInterval(function () {
  153. if (e.$elem.is(":visible")) {
  154. e.reload();
  155. e.$elem.animate({
  156. opacity: 1
  157. }, 200);
  158. clearInterval(e.checkVisible)
  159. }
  160. }, 500)
  161. },
  162. wrapItems: function () {
  163. var e = this;
  164. e.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>');
  165. e.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');
  166. e.wrapperOuter = e.$elem.find(".owl-wrapper-outer");
  167. e.$elem.css("display", "block")
  168. },
  169. baseClass: function () {
  170. var e = this;
  171. var t = e.$elem.hasClass(e.options.baseClass);
  172. var n = e.$elem.hasClass(e.options.theme);
  173. e.$elem.data("owl-originalStyles", e.$elem.attr("style")).data("owl-originalClasses", e.$elem.attr("class"));
  174. if (!t) {
  175. e.$elem.addClass(e.options.baseClass)
  176. }
  177. if (!n) {
  178. e.$elem.addClass(e.options.theme)
  179. }
  180. },
  181. updateItems: function () {
  182. var t = this;
  183. if (t.options.responsive === false) {
  184. return false
  185. }
  186. if (t.options.singleItem === true) {
  187. t.options.items = t.orignalItems = 1;
  188. t.options.itemsDesktop = false;
  189. t.options.itemsDesktopSmall = false;
  190. t.options.itemsTablet = false;
  191. t.options.itemsTabletSmall = false;
  192. t.options.itemsMobile = false;
  193. return false
  194. }
  195. var n = e(t.options.responsiveBaseWidth).width();
  196. if (n > (t.options.itemsDesktop[0] || t.orignalItems)) {
  197. t.options.items = t.orignalItems
  198. }
  199. if (n <= t.options.itemsDesktop[0] && t.options.itemsDesktop !== false) {
  200. t.options.items = t.options.itemsDesktop[1]
  201. }
  202. if (n <= t.options.itemsDesktopSmall[0] && t.options.itemsDesktopSmall !== false) {
  203. t.options.items = t.options.itemsDesktopSmall[1]
  204. }
  205. if (n <= t.options.itemsTablet[0] && t.options.itemsTablet !== false) {
  206. t.options.items = t.options.itemsTablet[1]
  207. }
  208. if (n <= t.options.itemsTabletSmall[0] && t.options.itemsTabletSmall !== false) {
  209. t.options.items = t.options.itemsTabletSmall[1]
  210. }
  211. if (n <= t.options.itemsMobile[0] && t.options.itemsMobile !== false) {
  212. t.options.items = t.options.itemsMobile[1]
  213. }
  214. if (t.options.items > t.itemsAmount && t.options.itemsScaleUp === true) {
  215. t.options.items = t.itemsAmount
  216. }
  217. },
  218. response: function () {
  219. var n = this,
  220. r;
  221. if (n.options.responsive !== true) {
  222. return false
  223. }
  224. var i = e(t).width();
  225. n.resizer = function () {
  226. if (e(t).width() !== i) {
  227. if (n.options.autoPlay !== false) {
  228. clearInterval(n.autoPlayInterval)
  229. }
  230. clearTimeout(r);
  231. r = setTimeout(function () {
  232. i = e(t).width();
  233. n.updateVars()
  234. }, n.options.responsiveRefreshRate)
  235. }
  236. };
  237. e(t).resize(n.resizer)
  238. },
  239. updatePosition: function () {
  240. var e = this;
  241. if (e.browser.support3d === true) {
  242. if (e.positionsInArray[e.currentItem] > e.maximumPixels) {
  243. e.transition3d(e.positionsInArray[e.currentItem])
  244. } else {
  245. e.transition3d(0);
  246. e.currentItem = 0
  247. }
  248. } else {
  249. if (e.positionsInArray[e.currentItem] > e.maximumPixels) {
  250. e.css2slide(e.positionsInArray[e.currentItem])
  251. } else {
  252. e.css2slide(0);
  253. e.currentItem = 0
  254. }
  255. } if (e.options.autoPlay !== false) {
  256. e.checkAp()
  257. }
  258. },
  259. appendItemsSizes: function () {
  260. var t = this;
  261. var n = 0;
  262. var r = t.itemsAmount - t.options.items;
  263. t.$owlItems.each(function (i) {
  264. var s = e(this);
  265. s.css({
  266. width: t.itemWidth
  267. }).data("owl-item", Number(i));
  268. if (i % t.options.items === 0 || i === r) {
  269. if (!(i > r)) {
  270. n += 1
  271. }
  272. }
  273. s.data("owl-roundPages", n)
  274. })
  275. },
  276. appendWrapperSizes: function () {
  277. var e = this;
  278. var t = 0;
  279. var t = e.$owlItems.length * e.itemWidth;
  280. e.$owlWrapper.css({
  281. width: t * 2,
  282. left: 0
  283. });
  284. e.appendItemsSizes()
  285. },
  286. calculateAll: function () {
  287. var e = this;
  288. e.calculateWidth();
  289. e.appendWrapperSizes();
  290. e.loops();
  291. e.max()
  292. },
  293. calculateWidth: function () {
  294. var e = this;
  295. e.itemWidth = Math.round(e.$elem.width() / e.options.items)
  296. },
  297. max: function () {
  298. var e = this;
  299. var t = (e.itemsAmount * e.itemWidth - e.options.items * e.itemWidth) * -1;
  300. if (e.options.items > e.itemsAmount) {
  301. e.maximumItem = 0;
  302. t = 0;
  303. e.maximumPixels = 0
  304. } else {
  305. e.maximumItem = e.itemsAmount - e.options.items;
  306. e.maximumPixels = t
  307. }
  308. return t
  309. },
  310. min: function () {
  311. return 0
  312. },
  313. loops: function () {
  314. var e = this;
  315. e.positionsInArray = [0];
  316. var t = 0;
  317. for (var n = 0; n < e.itemsAmount; n++) {
  318. t += e.itemWidth;
  319. e.positionsInArray.push(-t)
  320. }
  321. },
  322. buildControls: function () {
  323. var t = this;
  324. if (t.options.navigation === true || t.options.pagination === true) {
  325. t.owlControls = e('<div class="owl-controls"/>').toggleClass("clickable", !t.browser.isTouch).appendTo(t.$elem)
  326. }
  327. if (t.options.pagination === true) {
  328. t.buildPagination()
  329. }
  330. if (t.options.navigation === true) {
  331. t.buildButtons()
  332. }
  333. },
  334. buildButtons: function () {
  335. var t = this;
  336. var n = e('<div class="owl-buttons"/>');
  337. t.owlControls.append(n);
  338. t.buttonPrev = e("<div/>", {
  339. "class": "owl-prev",
  340. html: t.options.navigationText[0] || ""
  341. });
  342. t.buttonNext = e("<div/>", {
  343. "class": "owl-next",
  344. html: t.options.navigationText[1] || ""
  345. });
  346. n.append(t.buttonPrev).append(t.buttonNext);
  347. n.on("touchstart.owlControls mousedown.owlControls", 'div[class^="owl"]', function (e) {
  348. e.preventDefault()
  349. });
  350. n.on("touchend.owlControls mouseup.owlControls", 'div[class^="owl"]', function (n) {
  351. n.preventDefault();
  352. if (e(this).hasClass("owl-next")) {
  353. t.next()
  354. } else {
  355. t.prev()
  356. }
  357. })
  358. },
  359. buildPagination: function () {
  360. var t = this;
  361. t.paginationWrapper = e('<div class="owl-pagination"/>');
  362. t.owlControls.append(t.paginationWrapper);
  363. t.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (n) {
  364. n.preventDefault();
  365. if (Number(e(this).data("owl-page")) !== t.currentItem) {
  366. t.goTo(Number(e(this).data("owl-page")), true)
  367. }
  368. })
  369. },
  370. updatePagination: function () {
  371. var t = this;
  372. if (t.options.pagination === false) {
  373. return false
  374. }
  375. t.paginationWrapper.html("");
  376. var n = 0;
  377. var r = t.itemsAmount - t.itemsAmount % t.options.items;
  378. for (var i = 0; i < t.itemsAmount; i++) {
  379. if (i % t.options.items === 0) {
  380. n += 1;
  381. if (r === i) {
  382. var s = t.itemsAmount - t.options.items
  383. }
  384. var o = e("<div/>", {
  385. "class": "owl-page"
  386. });
  387. var u = e("<span></span>", {
  388. text: t.options.paginationNumbers === true ? n : "",
  389. "class": t.options.paginationNumbers === true ? "owl-numbers" : ""
  390. });
  391. o.append(u);
  392. o.data("owl-page", r === i ? s : i);
  393. o.data("owl-roundPages", n);
  394. t.paginationWrapper.append(o)
  395. }
  396. }
  397. t.checkPagination()
  398. },
  399. checkPagination: function () {
  400. var t = this;
  401. if (t.options.pagination === false) {
  402. return false
  403. }
  404. t.paginationWrapper.find(".owl-page").each(function (n, r) {
  405. if (e(this).data("owl-roundPages") === e(t.$owlItems[t.currentItem]).data("owl-roundPages")) {
  406. t.paginationWrapper.find(".owl-page").removeClass("active");
  407. e(this).addClass("active")
  408. }
  409. })
  410. },
  411. checkNavigation: function () {
  412. var e = this;
  413. if (e.options.navigation === false) {
  414. return false
  415. }
  416. if (e.options.rewindNav === false) {
  417. if (e.currentItem === 0 && e.maximumItem === 0) {
  418. e.buttonPrev.addClass("disabled");
  419. e.buttonNext.addClass("disabled")
  420. } else if (e.currentItem === 0 && e.maximumItem !== 0) {
  421. e.buttonPrev.addClass("disabled");
  422. e.buttonNext.removeClass("disabled")
  423. } else if (e.currentItem === e.maximumItem) {
  424. e.buttonPrev.removeClass("disabled");
  425. e.buttonNext.addClass("disabled")
  426. } else if (e.currentItem !== 0 && e.currentItem !== e.maximumItem) {
  427. e.buttonPrev.removeClass("disabled");
  428. e.buttonNext.removeClass("disabled")
  429. }
  430. }
  431. },
  432. updateControls: function () {
  433. var e = this;
  434. e.updatePagination();
  435. e.checkNavigation();
  436. if (e.owlControls) {
  437. if (e.options.items >= e.itemsAmount) {
  438. e.owlControls.hide()
  439. } else {
  440. e.owlControls.show()
  441. }
  442. }
  443. },
  444. destroyControls: function () {
  445. var e = this;
  446. if (e.owlControls) {
  447. e.owlControls.remove()
  448. }
  449. },
  450. next: function (e) {
  451. var t = this;
  452. if (t.isTransition) {
  453. return false
  454. }
  455. t.storePrevItem = t.currentItem;
  456. t.currentItem += t.options.scrollPerPage === true ? t.options.items : 1;
  457. if (t.currentItem > t.maximumItem + (t.options.scrollPerPage == true ? t.options.items - 1 : 0)) {
  458. if (t.options.rewindNav === true) {
  459. t.currentItem = 0;
  460. e = "rewind"
  461. } else {
  462. t.currentItem = t.maximumItem;
  463. return false
  464. }
  465. }
  466. t.goTo(t.currentItem, e)
  467. },
  468. prev: function (e) {
  469. var t = this;
  470. if (t.isTransition) {
  471. return false
  472. }
  473. t.storePrevItem = t.currentItem;
  474. if (t.options.scrollPerPage === true && t.currentItem > 0 && t.currentItem < t.options.items) {
  475. t.currentItem = 0
  476. } else {
  477. t.currentItem -= t.options.scrollPerPage === true ? t.options.items : 1
  478. } if (t.currentItem < 0) {
  479. if (t.options.rewindNav === true) {
  480. t.currentItem = t.maximumItem;
  481. e = "rewind"
  482. } else {
  483. t.currentItem = 0;
  484. return false
  485. }
  486. }
  487. t.goTo(t.currentItem, e)
  488. },
  489. goTo: function (e, t, n) {
  490. var r = this;
  491. if (r.isTransition) {
  492. return false
  493. }
  494. r.getPrevItem();
  495. if (typeof r.options.beforeMove === "function") {
  496. r.options.beforeMove.apply(this, [r.$elem])
  497. }
  498. if (e >= r.maximumItem) {
  499. e = r.maximumItem
  500. } else if (e <= 0) {
  501. e = 0
  502. }
  503. r.currentItem = r.owl.currentItem = e;
  504. if (r.options.transitionStyle !== false && n !== "drag" && r.options.items === 1 && r.browser.support3d === true) {
  505. r.swapSpeed(0);
  506. if (r.browser.support3d === true) {
  507. r.transition3d(r.positionsInArray[e])
  508. } else {
  509. r.css2slide(r.positionsInArray[e], 1)
  510. }
  511. r.singleItemTransition();
  512. r.afterGo();
  513. return false
  514. }
  515. var i = r.positionsInArray[e];
  516. if (r.browser.support3d === true) {
  517. r.isCss3Finish = false;
  518. if (t === true) {
  519. r.swapSpeed("paginationSpeed");
  520. setTimeout(function () {
  521. r.isCss3Finish = true
  522. }, r.options.paginationSpeed)
  523. } else if (t === "rewind") {
  524. r.swapSpeed(r.options.rewindSpeed);
  525. setTimeout(function () {
  526. r.isCss3Finish = true
  527. }, r.options.rewindSpeed)
  528. } else {
  529. r.swapSpeed("slideSpeed");
  530. setTimeout(function () {
  531. r.isCss3Finish = true
  532. }, r.options.slideSpeed)
  533. }
  534. r.transition3d(i)
  535. } else {
  536. if (t === true) {
  537. r.css2slide(i, r.options.paginationSpeed)
  538. } else if (t === "rewind") {
  539. r.css2slide(i, r.options.rewindSpeed)
  540. } else {
  541. r.css2slide(i, r.options.slideSpeed)
  542. }
  543. }
  544. r.afterGo()
  545. },
  546. getPrevItem: function () {
  547. var e = this;
  548. e.prevItem = e.owl.prevItem = e.storePrevItem === r ? e.currentItem : e.storePrevItem;
  549. e.storePrevItem = r
  550. },
  551. jumpTo: function (e) {
  552. var t = this;
  553. t.getPrevItem();
  554. if (typeof t.options.beforeMove === "function") {
  555. t.options.beforeMove.apply(this, [t.$elem])
  556. }
  557. if (e >= t.maximumItem || e === -1) {
  558. e = t.maximumItem
  559. } else if (e <= 0) {
  560. e = 0
  561. }
  562. t.swapSpeed(0);
  563. if (t.browser.support3d === true) {
  564. t.transition3d(t.positionsInArray[e])
  565. } else {
  566. t.css2slide(t.positionsInArray[e], 1)
  567. }
  568. t.currentItem = t.owl.currentItem = e;
  569. t.afterGo()
  570. },
  571. afterGo: function () {
  572. var e = this;
  573. e.checkPagination();
  574. e.checkNavigation();
  575. e.eachMoveUpdate();
  576. if (typeof e.options.afterMove === "function") {
  577. e.options.afterMove.apply(this, [e.$elem])
  578. }
  579. if (e.options.autoPlay !== false) {
  580. e.checkAp()
  581. }
  582. },
  583. stop: function () {
  584. var e = this;
  585. e.apStatus = "stop";
  586. clearInterval(e.autoPlayInterval)
  587. },
  588. checkAp: function () {
  589. var e = this;
  590. if (e.apStatus !== "stop") {
  591. e.play()
  592. }
  593. },
  594. play: function () {
  595. var e = this;
  596. e.apStatus = "play";
  597. if (e.options.autoPlay === false) {
  598. return false
  599. }
  600. clearInterval(e.autoPlayInterval);
  601. e.autoPlayInterval = setInterval(function () {
  602. e.next(true)
  603. }, e.options.autoPlay)
  604. },
  605. swapSpeed: function (e) {
  606. var t = this;
  607. if (e === "slideSpeed") {
  608. t.$owlWrapper.css(t.addCssSpeed(t.options.slideSpeed))
  609. } else if (e === "paginationSpeed") {
  610. t.$owlWrapper.css(t.addCssSpeed(t.options.paginationSpeed))
  611. } else if (typeof e !== "string") {
  612. t.$owlWrapper.css(t.addCssSpeed(e))
  613. }
  614. },
  615. addCssSpeed: function (e) {
  616. var t = this;
  617. return {
  618. "-webkit-transition": "all " + e + "ms ease",
  619. "-moz-transition": "all " + e + "ms ease",
  620. "-o-transition": "all " + e + "ms ease",
  621. transition: "all " + e + "ms ease"
  622. }
  623. },
  624. removeTransition: function () {
  625. return {
  626. "-webkit-transition": "",
  627. "-moz-transition": "",
  628. "-o-transition": "",
  629. transition: ""
  630. }
  631. },
  632. doTranslate: function (e) {
  633. return {
  634. "-webkit-transform": "translate3d(" + e + "px, 0px, 0px)",
  635. "-moz-transform": "translate3d(" + e + "px, 0px, 0px)",
  636. "-o-transform": "translate3d(" + e + "px, 0px, 0px)",
  637. "-ms-transform": "translate3d(" + e + "px, 0px, 0px)",
  638. transform: "translate3d(" + e + "px, 0px,0px)"
  639. }
  640. },
  641. transition3d: function (e) {
  642. var t = this;
  643. t.$owlWrapper.css(t.doTranslate(e))
  644. },
  645. css2move: function (e) {
  646. var t = this;
  647. t.$owlWrapper.css({
  648. left: e
  649. })
  650. },
  651. css2slide: function (e, t) {
  652. var n = this;
  653. n.isCssFinish = false;
  654. n.$owlWrapper.stop(true, true).animate({
  655. left: e
  656. }, {
  657. duration: t || n.options.slideSpeed,
  658. complete: function () {
  659. n.isCssFinish = true
  660. }
  661. })
  662. },
  663. checkBrowser: function () {
  664. var e = this;
  665. var r = "translate3d(0px, 0px, 0px)",
  666. i = n.createElement("div");
  667. i.style.cssText = " -moz-transform:" + r + "; -ms-transform:" + r + "; -o-transform:" + r + "; -webkit-transform:" + r + "; transform:" + r;
  668. var s = /translate3d\(0px, 0px, 0px\)/g,
  669. o = i.style.cssText.match(s),
  670. u = o !== null && o.length === 1;
  671. var a = "ontouchstart" in t || navigator.msMaxTouchPoints;
  672. e.browser = {
  673. support3d: u,
  674. isTouch: a
  675. }
  676. },
  677. moveEvents: function () {
  678. var e = this;
  679. if (e.options.mouseDrag !== false || e.options.touchDrag !== false) {
  680. e.gestures();
  681. e.disabledEvents()
  682. }
  683. },
  684. eventTypes: function () {
  685. var e = this;
  686. var t = ["s", "e", "x"];
  687. e.ev_types = {};
  688. if (e.options.mouseDrag === true && e.options.touchDrag === true) {
  689. t = ["touchstart.owl mousedown.owl", "touchmove.owl mousemove.owl", "touchend.owl touchcancel.owl mouseup.owl"]
  690. } else if (e.options.mouseDrag === false && e.options.touchDrag === true) {
  691. t = ["touchstart.owl", "touchmove.owl", "touchend.owl touchcancel.owl"]
  692. } else if (e.options.mouseDrag === true && e.options.touchDrag === false) {
  693. t = ["mousedown.owl", "mousemove.owl", "mouseup.owl"]
  694. }
  695. e.ev_types["start"] = t[0];
  696. e.ev_types["move"] = t[1];
  697. e.ev_types["end"] = t[2]
  698. },
  699. disabledEvents: function () {
  700. var t = this;
  701. t.$elem.on("dragstart.owl", function (e) {
  702. e.preventDefault()
  703. });
  704. t.$elem.on("mousedown.disableTextSelect", function (t) {
  705. return e(t.target).is("input, textarea, select, option")
  706. })
  707. },
  708. gestures: function () {
  709. function o(e) {
  710. if (e.touches) {
  711. return {
  712. x: e.touches[0].pageX,
  713. y: e.touches[0].pageY
  714. }
  715. } else {
  716. if (e.pageX !== r) {
  717. return {
  718. x: e.pageX,
  719. y: e.pageY
  720. }
  721. } else {
  722. return {
  723. x: e.clientX,
  724. y: e.clientY
  725. }
  726. }
  727. }
  728. }
  729. function u(t) {
  730. if (t === "on") {
  731. e(n).on(i.ev_types["move"], f);
  732. e(n).on(i.ev_types["end"], l)
  733. } else if (t === "off") {
  734. e(n).off(i.ev_types["move"]);
  735. e(n).off(i.ev_types["end"])
  736. }
  737. }
  738. function a(n) {
  739. var n = n.originalEvent || n || t.event;
  740. if (n.which === 3) {
  741. return false
  742. }
  743. if (i.isCssFinish === false && !i.options.dragBeforeAnimFinish) {
  744. return false
  745. }
  746. if (i.isCss3Finish === false && !i.options.dragBeforeAnimFinish) {
  747. return false
  748. }
  749. if (i.options.autoPlay !== false) {
  750. clearInterval(i.autoPlayInterval)
  751. }
  752. if (i.browser.isTouch !== true && !i.$owlWrapper.hasClass("grabbing")) {
  753. i.$owlWrapper.addClass("grabbing")
  754. }
  755. i.newPosX = 0;
  756. i.newRelativeX = 0;
  757. e(this).css(i.removeTransition());
  758. var r = e(this).position();
  759. s.relativePos = r.left;
  760. s.offsetX = o(n).x - r.left;
  761. s.offsetY = o(n).y - r.top;
  762. u("on");
  763. s.sliding = false;
  764. s.targetElement = n.target || n.srcElement
  765. }
  766. function f(r) {
  767. var r = r.originalEvent || r || t.event;
  768. i.newPosX = o(r).x - s.offsetX;
  769. i.newPosY = o(r).y - s.offsetY;
  770. i.newRelativeX = i.newPosX - s.relativePos;
  771. if (typeof i.options.startDragging === "function" && s.dragging !== true && i.newRelativeX !== 0) {
  772. s.dragging = true;
  773. i.options.startDragging.apply(this)
  774. }
  775. if (i.newRelativeX > 8 || i.newRelativeX < -8 && i.browser.isTouch === true) {
  776. r.preventDefault ? r.preventDefault() : r.returnValue = false;
  777. s.sliding = true
  778. }
  779. if ((i.newPosY > 10 || i.newPosY < -10) && s.sliding === false) {
  780. e(n).off("touchmove.owl")
  781. }
  782. var u = function () {
  783. return i.newRelativeX / 5
  784. };
  785. var a = function () {
  786. return i.maximumPixels + i.newRelativeX / 5
  787. };
  788. i.newPosX = Math.max(Math.min(i.newPosX, u()), a());
  789. if (i.browser.support3d === true) {
  790. i.transition3d(i.newPosX)
  791. } else {
  792. i.css2move(i.newPosX)
  793. }
  794. }
  795. function l(n) {
  796. var n = n.originalEvent || n || t.event;
  797. n.target = n.target || n.srcElement;
  798. s.dragging = false;
  799. if (i.browser.isTouch !== true) {
  800. i.$owlWrapper.removeClass("grabbing")
  801. }
  802. if (i.newRelativeX !== 0) {
  803. var r = i.getNewPosition();
  804. i.goTo(r, false, "drag");
  805. if (s.targetElement === n.target && i.browser.isTouch !== true) {
  806. e(n.target).on("click.disable", function (t) {
  807. t.stopImmediatePropagation();
  808. t.stopPropagation();
  809. t.preventDefault();
  810. e(n.target).off("click.disable")
  811. });
  812. var o = e._data(n.target, "events")["click"];
  813. var a = o.pop();
  814. o.splice(0, 0, a)
  815. }
  816. }
  817. u("off")
  818. }
  819. var i = this;
  820. var s = {
  821. offsetX: 0,
  822. offsetY: 0,
  823. baseElWidth: 0,
  824. relativePos: 0,
  825. position: null,
  826. minSwipe: null,
  827. maxSwipe: null,
  828. sliding: null,
  829. dargging: null,
  830. targetElement: null
  831. };
  832. i.isCssFinish = true;
  833. i.$elem.on(i.ev_types["start"], ".owl-wrapper", a)
  834. },
  835. getNewPosition: function () {
  836. var e = this,
  837. t;
  838. var t = e.improveClosest();
  839. if (t > e.maximumItem) {
  840. e.currentItem = e.maximumItem;
  841. t = e.maximumItem
  842. } else if (e.newPosX >= 0) {
  843. t = 0;
  844. e.currentItem = 0
  845. }
  846. return t
  847. },
  848. improveClosest: function () {
  849. var t = this;
  850. var n = t.positionsInArray;
  851. var r = t.newPosX;
  852. var i = null;
  853. e.each(n, function (e, s) {
  854. if (r - t.itemWidth / 20 > n[e + 1] && r - t.itemWidth / 20 < s && t.moveDirection() === "left") {
  855. i = s;
  856. t.currentItem = e
  857. } else if (r + t.itemWidth / 20 < s && r + t.itemWidth / 20 > n[e + 1] && t.moveDirection() === "right") {
  858. i = n[e + 1];
  859. t.currentItem = e + 1
  860. }
  861. });
  862. return t.currentItem
  863. },
  864. moveDirection: function () {
  865. var e = this,
  866. t;
  867. if (e.newRelativeX < 0) {
  868. t = "right";
  869. e.playDirection = "next"
  870. } else {
  871. t = "left";
  872. e.playDirection = "prev"
  873. }
  874. return t
  875. },
  876. customEvents: function () {
  877. var e = this;
  878. e.$elem.on("owl.next", function () {
  879. e.next()
  880. });
  881. e.$elem.on("owl.prev", function () {
  882. e.prev()
  883. });
  884. e.$elem.on("owl.play", function (t, n) {
  885. e.options.autoPlay = n;
  886. e.play();
  887. e.hoverStatus = "play"
  888. });
  889. e.$elem.on("owl.stop", function () {
  890. e.stop();
  891. e.hoverStatus = "stop"
  892. });
  893. e.$elem.on("owl.goTo", function (t, n) {
  894. e.goTo(n)
  895. });
  896. e.$elem.on("owl.jumpTo", function (t, n) {
  897. e.jumpTo(n)
  898. })
  899. },
  900. stopOnHover: function () {
  901. var e = this;
  902. if (e.options.stopOnHover === true && e.browser.isTouch !== true && e.options.autoPlay !== false) {
  903. e.$elem.on("mouseover", function () {
  904. e.stop()
  905. });
  906. e.$elem.on("mouseout", function () {
  907. if (e.hoverStatus !== "stop") {
  908. e.play()
  909. }
  910. })
  911. }
  912. },
  913. lazyLoad: function () {
  914. var t = this;
  915. if (t.options.lazyLoad === false) {
  916. return false
  917. }
  918. for (var n = 0; n < t.itemsAmount; n++) {
  919. var i = e(t.$owlItems[n]);
  920. if (i.data("owl-loaded") === "loaded") {
  921. continue
  922. }
  923. var s = i.data("owl-item"),
  924. o = i.find(".lazyOwl"),
  925. u;
  926. if (typeof o.data("src") !== "string") {
  927. i.data("owl-loaded", "loaded");
  928. continue
  929. }
  930. if (i.data("owl-loaded") === r) {
  931. o.hide();
  932. i.addClass("loading").data("owl-loaded", "checked")
  933. }
  934. if (t.options.lazyFollow === true) {
  935. u = s >= t.currentItem
  936. } else {
  937. u = true
  938. } if (u && s < t.currentItem + t.options.items && o.length) {
  939. t.lazyPreload(i, o)
  940. }
  941. }
  942. },
  943. lazyPreload: function (e, t) {
  944. function i() {
  945. r += 1;
  946. if (n.completeImg(t.get(0))) {
  947. s()
  948. } else if (r <= 100) {
  949. setTimeout(i, 100)
  950. } else {
  951. s()
  952. }
  953. }
  954. function s() {
  955. e.data("owl-loaded", "loaded").removeClass("loading");
  956. t.removeAttr("data-src");
  957. n.options.lazyEffect === "fade" ? t.fadeIn(400) : t.show()
  958. }
  959. var n = this,
  960. r = 0;
  961. t[0].src = t.data("src");
  962. i()
  963. },
  964. autoHeight: function () {
  965. function s() {
  966. i += 1;
  967. if (t.completeImg(n.get(0))) {
  968. o()
  969. } else if (i <= 100) {
  970. setTimeout(s, 100)
  971. } else {
  972. t.wrapperOuter.css("height", "")
  973. }
  974. }
  975. function o() {
  976. var n = e(t.$owlItems[t.currentItem]).height();
  977. t.wrapperOuter.css("height", n + "px");
  978. if (!t.wrapperOuter.hasClass("autoHeight")) {
  979. setTimeout(function () {
  980. t.wrapperOuter.addClass("autoHeight")
  981. }, 0)
  982. }
  983. }
  984. var t = this;
  985. var n = e(t.$owlItems[t.currentItem]).find("img");
  986. if (n.get(0) !== r) {
  987. var i = 0;
  988. s()
  989. } else {
  990. o()
  991. }
  992. },
  993. completeImg: function (e) {
  994. if (!e.complete) {
  995. return false
  996. }
  997. if (typeof e.naturalWidth !== "undefined" && e.naturalWidth == 0) {
  998. return false
  999. }
  1000. return true
  1001. },
  1002. onVisibleItems: function () {
  1003. var t = this;
  1004. if (t.options.addClassActive === true) {
  1005. t.$owlItems.removeClass("active")
  1006. }
  1007. t.visibleItems = [];
  1008. for (var n = t.currentItem; n < t.currentItem + t.options.items; n++) {
  1009. t.visibleItems.push(n);
  1010. if (t.options.addClassActive === true) {
  1011. e(t.$owlItems[n]).addClass("active")
  1012. }
  1013. }
  1014. t.owl.visibleItems = t.visibleItems
  1015. },
  1016. transitionTypes: function (e) {
  1017. var t = this;
  1018. t.outClass = "owl-" + e + "-out";
  1019. t.inClass = "owl-" + e + "-in"
  1020. },
  1021. singleItemTransition: function () {
  1022. function u(e, t) {
  1023. return {
  1024. position: "relative",
  1025. left: e + "px"
  1026. }
  1027. }
  1028. var e = this;
  1029. e.isTransition = true;
  1030. var t = e.outClass,
  1031. n = e.inClass,
  1032. r = e.$owlItems.eq(e.currentItem),
  1033. i = e.$owlItems.eq(e.prevItem),
  1034. s = Math.abs(e.positionsInArray[e.currentItem]) + e.positionsInArray[e.prevItem],
  1035. o = Math.abs(e.positionsInArray[e.currentItem]) + e.itemWidth / 2;
  1036. e.$owlWrapper.addClass("owl-origin").css({
  1037. "-webkit-transform-origin": o + "px",
  1038. "-moz-perspective-origin": o + "px",
  1039. "perspective-origin": o + "px"
  1040. });
  1041. var a = "webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend";
  1042. i.css(u(s, 10)).addClass(t).on(a, function () {
  1043. e.endPrev = true;
  1044. i.off(a);
  1045. e.clearTransStyle(i, t)
  1046. });
  1047. r.addClass(n).on(a, function () {
  1048. e.endCurrent = true;
  1049. r.off(a);
  1050. e.clearTransStyle(r, n)
  1051. })
  1052. },
  1053. clearTransStyle: function (e, t) {
  1054. var n = this;
  1055. e.css({
  1056. position: "",
  1057. left: ""
  1058. }).removeClass(t);
  1059. if (n.endPrev && n.endCurrent) {
  1060. n.$owlWrapper.removeClass("owl-origin");
  1061. n.endPrev = false;
  1062. n.endCurrent = false;
  1063. n.isTransition = false
  1064. }
  1065. },
  1066. owlStatus: function () {
  1067. var e = this;
  1068. e.owl = {
  1069. userOptions: e.userOptions,
  1070. baseElement: e.$elem,
  1071. userItems: e.$userItems,
  1072. owlItems: e.$owlItems,
  1073. currentItem: e.currentItem,
  1074. prevItem: e.prevItem,
  1075. visibleItems: e.visibleItems,
  1076. isTouch: e.browser.isTouch,
  1077. browser: e.browser
  1078. }
  1079. },
  1080. clearEvents: function () {
  1081. var r = this;
  1082. r.$elem.off(".owl owl mousedown.disableTextSelect");
  1083. e(n).off(".owl owl");
  1084. e(t).off("resize", r.resizer)
  1085. },
  1086. unWrap: function () {
  1087. var e = this;
  1088. if (e.$elem.children().length !== 0) {
  1089. e.$owlWrapper.unwrap();
  1090. e.$userItems.unwrap().unwrap();
  1091. if (e.owlControls) {
  1092. e.owlControls.remove()
  1093. }
  1094. }
  1095. e.clearEvents();
  1096. e.$elem.attr("style", e.$elem.data("owl-originalStyles") || "").attr("class", e.$elem.data("owl-originalClasses"))
  1097. },
  1098. destroy: function () {
  1099. var e = this;
  1100. e.stop();
  1101. clearInterval(e.checkVisible);
  1102. e.unWrap();
  1103. e.$elem.removeData()
  1104. },
  1105. reinit: function (t) {
  1106. var n = this;
  1107. var r = e.extend({}, n.userOptions, t);
  1108. n.unWrap();
  1109. n.init(r, n.$elem)
  1110. },
  1111. addItem: function (e, t) {
  1112. var n = this,
  1113. i;
  1114. if (!e) {
  1115. return false
  1116. }
  1117. if (n.$elem.children().length === 0) {
  1118. n.$elem.append(e);
  1119. n.setVars();
  1120. return false
  1121. }
  1122. n.unWrap();
  1123. if (t === r || t === -1) {
  1124. i = -1
  1125. } else {
  1126. i = t
  1127. } if (i >= n.$userItems.length || i === -1) {
  1128. n.$userItems.eq(-1).after(e)
  1129. } else {
  1130. n.$userItems.eq(i).before(e)
  1131. }
  1132. n.setVars()
  1133. },
  1134. removeItem: function (e) {
  1135. var t = this,
  1136. n;
  1137. if (t.$elem.children().length === 0) {
  1138. return false
  1139. }
  1140. if (e === r || e === -1) {
  1141. n = -1
  1142. } else {
  1143. n = e
  1144. }
  1145. t.unWrap();
  1146. t.$userItems.eq(n).remove();
  1147. t.setVars()
  1148. }
  1149. };
  1150. e.fn.owlCarousel = function (t) {
  1151. return this.each(function () {
  1152. if (e(this).data("owl-init") === true) {
  1153. return false
  1154. }
  1155. e(this).data("owl-init", true);
  1156. var n = Object.create(i);
  1157. n.init(t, this);
  1158. e.data(this, "owlCarousel", n)
  1159. })
  1160. };
  1161. e.fn.owlCarousel.options = {
  1162. items: 4,
  1163. itemsDesktop: [1199, 3],
  1164. itemsDesktopSmall: [979, 2],
  1165. itemsTablet: [768, 1],
  1166. itemsTabletSmall: false,
  1167. itemsMobile: [479, 1],
  1168. singleItem: false,
  1169. itemsScaleUp: false,
  1170. slideSpeed: 200,
  1171. paginationSpeed: 800,
  1172. rewindSpeed: 1e3,
  1173. autoPlay: false,
  1174. stopOnHover: false,
  1175. navigation: false,
  1176. navigationText: ["", ""],
  1177. rewindNav: true,
  1178. scrollPerPage: false,
  1179. pagination: true,
  1180. paginationNumbers: false,
  1181. responsive: true,
  1182. responsiveRefreshRate: 200,
  1183. responsiveBaseWidth: t,
  1184. baseClass: "owl-carousel",
  1185. theme: "owl-theme",
  1186. lazyLoad: false,
  1187. lazyFollow: true,
  1188. lazyEffect: "fade",
  1189. autoHeight: false,
  1190. jsonPath: false,
  1191. jsonSuccess: false,
  1192. dragBeforeAnimFinish: true,
  1193. mouseDrag: true,
  1194. touchDrag: true,
  1195. addClassActive: false,
  1196. transitionStyle: false,
  1197. beforeUpdate: false,
  1198. afterUpdate: false,
  1199. beforeInit: false,
  1200. afterInit: false,
  1201. beforeMove: false,
  1202. afterMove: false,
  1203. afterAction: false,
  1204. startDragging: false
  1205. }
  1206. })(jQuery, window, document)