owl.carousel.js 51 KB

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