Viewing File: /home/eticmes/www/wp-content/plugins/ultimate-post-kit/assets/vendor/js/newsticker.min.js
!function(t){"use strict";t.upkNewsTicker=function(i,e){var s={effect:"fade",direction:"ltr",autoPlay:!1,interval:4e3,scrollSpeed:2,pauseOnHover:!1,position:"auto",zIndex:99999},n=this;n.settings={},n._element=t(i),n._label=n._element.children(".upk-news-ticker-label"),n._news=n._element.children(".upk-news-ticker-content"),n._ul=n._news.children("ul"),n._li=n._ul.children("li"),n._controls=n._element.children(".upk-news-ticker-controls"),n._prev=n._controls.find(".upk-news-ticker-prev").parent(),n._action=n._controls.find(".upk-news-ticker-action").parent(),n._next=n._controls.find(".upk-news-ticker-next").parent(),n._pause=!1,n._controlsIsActive=!0,n._totalNews=n._ul.children("li").length,n._activeNews=0,n._interval=!1,n._frameId=null;var l=function(){var t=parseFloat(n._ul.css("marginLeft"));t-=n.settings.scrollSpeed/2,n._ul.css({marginLeft:t}),t<=-n._ul.find("li:first-child").outerWidth()&&(n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginLeft:0})),!1===n._pause&&(n._frameId=requestAnimationFrame(l),window.requestAnimationFrame&&n._frameId||setTimeout(l,16))},a=function(){var t=parseFloat(n._ul.css("marginRight"));t-=n.settings.scrollSpeed/2,n._ul.css({marginRight:t}),t<=-n._ul.find("li:first-child").outerWidth()&&(n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginRight:0})),!1===n._pause&&(n._frameId=requestAnimationFrame(a)),window.requestAnimationFrame&&n._frameId||setTimeout(a,16)},c=function(){"rtl"===n.settings.direction?n._ul.stop().animate({marginRight:-n._ul.find("li:first-child").outerWidth()},300,(function(){n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginRight:0}),n._controlsIsActive=!0})):n._ul.stop().animate({marginLeft:-n._ul.find("li:first-child").outerWidth()},300,(function(){n._ul.find("li:first-child").insertAfter(n._ul.find("li:last-child")),n._ul.css({marginLeft:0}),n._controlsIsActive=!0}))},o=function(){"rtl"===n.settings.direction?(parseInt(n._ul.css("marginRight"),10)>=0&&(n._ul.css({"margin-right":-n._ul.find("li:last-child").outerWidth()}),n._ul.find("li:last-child").insertBefore(n._ul.find("li:first-child"))),n._ul.stop().animate({marginRight:0},300,(function(){n._controlsIsActive=!0}))):(parseInt(n._ul.css("marginLeft"),10)>=0&&(n._ul.css({"margin-left":-n._ul.find("li:last-child").outerWidth()}),n._ul.find("li:last-child").insertBefore(n._ul.find("li:first-child"))),n._ul.stop().animate({marginLeft:0},300,(function(){n._controlsIsActive=!0})))},r=function(){switch(n._controlsIsActive=!0,n.settings.effect){case"typography":n._ul.find("li").hide(),n._ul.find("li").eq(n._activeNews).width(30).show(),n._ul.find("li").eq(n._activeNews).animate({width:"100%",opacity:1},1500);break;case"fade":n._ul.find("li").hide(),n._ul.find("li").eq(n._activeNews).fadeIn();break;case"slide-down":n._totalNews<=1?n._ul.find("li").animate({top:30,opacity:0},300,(function(){t(this).css({top:-30,opacity:0,display:"block"}),t(this).animate({top:0,opacity:1},300)})):(n._ul.find("li:visible").animate({top:30,opacity:0},300,(function(){t(this).hide()})),n._ul.find("li").eq(n._activeNews).css({top:-30,opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({top:0,opacity:1},300));break;case"slide-up":n._totalNews<=1?n._ul.find("li").animate({top:-30,opacity:0},300,(function(){t(this).css({top:30,opacity:0,display:"block"}),t(this).animate({top:0,opacity:1},300)})):(n._ul.find("li:visible").animate({top:-30,opacity:0},300,(function(){t(this).hide()})),n._ul.find("li").eq(n._activeNews).css({top:30,opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({top:0,opacity:1},300));break;case"slide-right":n._totalNews<=1?n._ul.find("li").animate({left:"50%",opacity:0},300,(function(){t(this).css({left:-50,opacity:0,display:"block"}),t(this).animate({left:0,opacity:1},300)})):(n._ul.find("li:visible").animate({left:"50%",opacity:0},300,(function(){t(this).hide()})),n._ul.find("li").eq(n._activeNews).css({left:-50,opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({left:0,opacity:1},300));break;case"slide-left":n._totalNews<=1?n._ul.find("li").animate({left:"-50%",opacity:0},300,(function(){t(this).css({left:"50%",opacity:0,display:"block"}),t(this).animate({left:0,opacity:1},300)})):(n._ul.find("li:visible").animate({left:"-50%",opacity:0},300,(function(){t(this).hide()})),n._ul.find("li").eq(n._activeNews).css({left:"50%",opacity:0}).show(),n._ul.find("li").eq(n._activeNews).animate({left:0,opacity:1},300));break;default:n._ul.find("li").hide(),n._ul.find("li").eq(n._activeNews).show()}},u=function(){if(n._pause=!1,n.settings.autoPlay)if("scroll"===n.settings.effect)"rtl"===n.settings.direction?n._ul.width()>n._news.width()?a():n._ul.css({marginRight:0}):n._ul.width()>n._news.width()?l():n._ul.css({marginLeft:0});else n.pause(),n._interval=setInterval((function(){n.next()}),n.settings.interval)},_=function(){n._element.width()<480?(n._label.hide(),"rtl"==n.settings.direction?n._news.css({right:0}):n._news.css({left:0})):(n._label.show(),"rtl"==n.settings.direction?n._news.css({right:n._label.outerWidth()}):n._news.css({left:n._label.outerWidth()}))};n.init=function(){n.settings=t.extend({},s,e),n._element.addClass("upk-effect-"+n.settings.effect+" upk-direction-"+n.settings.direction),function(){if(n._label.length>0&&("rtl"==n.settings.direction?n._news.css({right:n._label.outerWidth()}):n._news.css({left:n._label.outerWidth()})),n._controls.length>0){var i=n._controls.outerWidth();"rtl"==n.settings.direction?n._news.css({left:i}):n._news.css({right:i})}if("scroll"===n.settings.effect){var e=0;n._li.each((function(){e+=t(this).outerWidth()})),e+=50,n._ul.css({width:e})}}(),"scroll"!=n.settings.effect&&r(),u(),n.settings.autoPlay?n._action.find("span").removeClass("upk-news-ticker-play").addClass("upk-news-ticker-pause"):n._action.find("span").removeClass("upk-news-ticker-pause").addClass("upk-news-ticker-play"),n._element.on("mouseleave",(function(i){var e=t(document.elementFromPoint(i.clientX,i.clientY)).parents(".upk-breaking-news")[0];t(this)[0]!==e&&(!0===n.settings.pauseOnHover?!0===n.settings.autoPlay&&n.play():!0===n.settings.autoPlay&&!0===n._pause&&n.play())})),n._element.on("mouseenter",(function(){!0===n.settings.pauseOnHover&&n.pause()})),n._next.on("click",(function(){n._controlsIsActive&&(n._controlsIsActive=!1,n.pause(),n.next())})),n._prev.on("click",(function(){n._controlsIsActive&&(n._controlsIsActive=!1,n.pause(),n.prev())})),n._action.on("click",(function(){n._controlsIsActive&&(n._action.find("span").hasClass("upk-news-ticker-pause")?(n._action.find("span").removeClass("upk-news-ticker-pause").addClass("upk-news-ticker-play"),n.stop()):(n.settings.autoPlay=!0,n._action.find("span").removeClass("upk-news-ticker-play").addClass("upk-news-ticker-pause")))})),_(),t(window).on("resize",(function(){_(),n.pause(),n.play()}))},n.pause=function(){n._pause=!0,clearInterval(n._interval),cancelAnimationFrame(n._frameId)},n.stop=function(){n._pause=!0,n.settings.autoPlay=!1},n.play=function(){u()},n.next=function(){"scroll"===n.settings.effect?c():(n._activeNews++,n._activeNews>=n._totalNews&&(n._activeNews=0),r())},n.prev=function(){"scroll"===n.settings.effect?o():(n._activeNews--,n._activeNews<0&&(n._activeNews=n._totalNews-1),r())},n.init()},t.fn.upkNewsTicker=function(i){return this.each((function(){if(null==t(this).data("upkNewsTicker")){var e=new t.upkNewsTicker(this,i);t(this).data("upkNewsTicker",e)}}))}}(jQuery);
Back to Directory
File Manager