owl.carousel.js 52 KB

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