$(document).ready(function () { if ($(".kslider-wrapper").length) { let $owl = $('.kslider-wrapper'); $owl.owlCarousel({ dots: true, nav: false, items: 1, loop: true, autoplay: true, autoplayTimeout: 20000, autoplayHoverPause: false, }); } }); window.customModule = { mqls: (function(undefined) { var _mqls = {}; return { push: function(key, callback, execute) { if (!_mqls[key]) { _mqls[key] = []; } _mqls[key].push({ callback: callback, execute: execute === undefined ? true : !!execute, }); }, process: function() { $.each(_mqls, function(key) { var mql = window.matchMedia(key); $.each(this, function() { mql.addListener(this.callback); if (this.execute) { this.callback(mql); } }); }); }, }; })(), }; $(document).ready(function() { new function() { customModule.mqls.push('(max-width:767px)', function(mql) { if (mql.matches) { tippy('.ktooltip', { content(reference) { var $id = reference.getAttribute('kdata-template'); var $template = document.getElementsByClassName($id); return $template[0].innerHTML; }, allowHTML: true, arrow: true, interactive: true, placement: 'top-start', }); } else { tippy('.ktooltip', { content(reference) { var $id = reference.getAttribute('kdata-template'); var $template = document.getElementsByClassName($id); return $template[0].innerHTML; }, allowHTML: true, arrow: true, interactive: true, placement: 'right-start', }); } }); }; customModule.mqls.process(); $('[kdata-toggle]').on('click', function(e) { e.preventDefault(); console.log($('div[kdata-toggle-content="'+$(this).attr('kdata-toggle')+'"]')); $(this).toggleClass('kactive'); $('div[kdata-toggle-content="'+$(this).attr('kdata-toggle')+'"]').toggle(); }); $('.klists-wrapper .kcontent ul li figure').each(function () { const link = $(this).data('link'); if (link) { $(this).wrap(''); } }); });