File: /home4/narrativ/public_html/wp-content/themes/jnews/assets/js/jnewsticker.js
!function(){"use strict";window.jnews=window.jnews||{},window.jnews.ticker=window.jnews.ticker||{};var e,n,t=(e=window,n=document,function(t){t=function(){for(var e,n,t,i=arguments[0]||{},a=1,o=arguments.length;a<o;a++)if(null!==(e=arguments[a]))for(n in e)i!==(t=e[n])&&void 0!==t&&(i[n]=t);return i}({container:".jeg_news_ticker",autoplay:!0,delay:3e3,animation:"vertical",item:".jeg_news_ticker_item",classes:{active_class:"jeg_news_ticker_active"}},t||{});var i=e.console&&"function"==typeof e.console.warn,a={};if(["container","item"].forEach((function(e){if("string"==typeof t[e]){var o=t[e],c="item"===e&&t.container&&t.container.nodeName?t.container.querySelectorAll(o):n.querySelector(o);if(a[e]=o,!c||!(c.nodeName||"object"==typeof c&&c.length))return void(i&&console.warn("Can't find",t[e]));t[e]=c}})),t.container.children.length<1)i&&console.warn("No item found in",t.container);else{var o=t.container,c=t.item,s=0,r=null,l=null,d=0,u=null,f="jeg_news_ticker_active",w=["fadeInLeft","fadeInRight","fadeOutLeft","fadeOutRight"],v=["fadeInUp","fadeInDown","fadeOutDown","fadeOutUp"],m=null;t.animation=o.dataset.animation,t.autoplay=o.dataset.autoplay,t.delay=o.dataset.delay,(d=c.length)>1?("horizontal"===t.animation?m=w:"vertical"===t.animation&&(m=v),o.querySelector(".jeg_news_ticker_control").addEventListener("click",(function(e){var n="";e.target.classList.contains("jeg_news_ticker_next")&&(n="next"),e.target.classList.contains("jeg_news_ticker_prev")&&(n="prev"),""!==n&&_(n)})),c.forEach((function(e,n){e.addEventListener("mouseover",(function(){clearTimeout(u)})),e.addEventListener("mouseout",(function(){g()}))})),g(),_("next")):c[0].classList.add(f)}function _(e){!function(){if(null!==r){var e=c[r];m.forEach((function(n,t){e.classList.remove(n)}))}}(),function(e){var n=c[s],t=c[l];r=l,"next"===e?(null!==l&&(t.classList.remove(f,m[0],m[1]),t.classList.add(m[3])),n.classList.add(f,m[0])):(null!==l&&(t.classList.remove(f,m[0],m[1]),t.classList.add(m[2])),n.classList.add(f,m[1]))}(e),function(e){l=s,"next"===e?s++:s--,s>=d&&(s=0),s<0&&(s=d-1)}(e),g()}function g(){t.autoplay&&(window.clearTimeout(u),u=window.setTimeout((function(){_("next")}),t.delay))}});window.jnews.ticker=t}();