| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.3/wp-content/plugins/Ultimate_VC_Addons/assets/js/ |
Upload File : |
/*
* jQuery - Easy Ticker plugin - v3.2.1
* https://www.aakashweb.com/
* Copyright 2021, Aakash Chakravarthy
* Released under the MIT License.
*/
;(function ($, window, document, undefined) {
var name = "easyTicker",
defaults = {
direction: 'up',
easing: 'swing',
speed: 'slow',
interval: 2000,
height: 'auto',
visible: 0,
mousePause: true,
controls: {
up: '',
down: '',
toggle: '',
playText: 'Play',
stopText: 'Stop'
},
callbacks: {
before: false,
after: false
}
};
// Constructor
function EasyTicker(el, options) {
var s = this;
s.opts = $.extend({}, defaults, options);
s.elem = $(el);
s.targ = $(el).children(':first-child');
s.timer = 0;
init();
start();
tabFocusHandle();
if(s.opts.mousePause){
s.elem.on('mouseenter', function(){
s.timerTemp = s.timer;
stop();
}).on('mouseleave', function(){
if(s.timerTemp !== 0)
start();
});
}
$(s.opts.controls.up).on('click', function(e){
e.preventDefault();
moveDir('up');
});
$(s.opts.controls.down).on('click', function(e){
e.preventDefault();
moveDir('down');
});
$(s.opts.controls.toggle).on('click', function(e){
e.preventDefault();
if(s.timer == 0) start();
else stop();
});
function init(){
s.elem.children().css('margin', 0).children().css('margin', 0);
s.elem.css({
position: 'relative',
height: s.opts.height,
overflow: 'hidden'
});
s.targ.css({
'position': 'absolute',
'margin': 0
});
s.heightTimer = setInterval(function(){
adjustHeight(false);
}, 100);
}
function start(){
if(s.timer != 0)
return;
s.timer = setInterval(function(){
move(s.opts.direction);
}, s.opts.interval);
$(s.opts.controls.toggle).addClass('et-run').html(s.opts.controls.stopText);
}
function stop(){
clearInterval(s.timer);
s.timer = 0;
$(s.opts.controls.toggle).removeClass('et-run').html(s.opts.controls.playText);
}
function move(dir){
var sel, eq, appType;
if(!s.elem.is(':visible')) return;
if(dir == 'up'){
sel = ':first-child';
eq = '-=';
appType = 'appendTo';
}else{
sel = ':last-child';
eq = '+=';
appType = 'prependTo';
}
var selChild = s.targ.children(sel);
var height = selChild.outerHeight();
if(typeof s.opts.callbacks.before === 'function'){
s.opts.callbacks.before.call(s, s.targ, selChild);
}
s.targ.stop(true, true).animate({
'top': eq + height + 'px'
}, s.opts.speed, s.opts.easing, function(){
selChild.hide()[appType](s.targ).fadeIn();
s.targ.css('top', 0);
adjustHeight(true);
if(typeof s.opts.callbacks.after === 'function'){
s.opts.callbacks.after.call(s, s.targ, selChild);
}
});
}
function moveDir(dir){
stop();
if(dir == 'up') move('up'); else move('down');
// start();
}
function setFullHeight(){
var height = 0;
var tempDisplay = s.elem.css('display'); // Get the current el display value
s.elem.css('display', 'block');
s.targ.children().each(function(){
height += $(this).outerHeight();
});
s.elem.css({
'display': tempDisplay,
'height': height
});
}
function setVisibleHeight(animate){
var wrapHeight = 0;
var visibleItemClass = 'et-item-visible';
s.targ.children().removeClass(visibleItemClass);
s.targ.children(':lt(' + s.opts.visible + ')').each(function(){
wrapHeight += $(this).outerHeight();
$(this).addClass(visibleItemClass);
});
if(animate){
s.elem.stop(true, true).animate({height: wrapHeight}, s.opts.speed);
}else{
s.elem.css('height', wrapHeight);
}
}
function adjustHeight(animate){
if(s.opts.height == 'auto'){
if(s.opts.visible > 0){
setVisibleHeight(animate);
}else{
setFullHeight();
}
}
if(!animate){
clearInterval(s.heightTimer);
}
}
function tabFocusHandle(){
var hidden, visibilityChange;
if(typeof document.hidden !== 'undefined'){
hidden = 'hidden';
visibilityChange = 'visibilitychange';
}else if (typeof document.msHidden !== 'undefined'){
hidden = 'msHidden';
visibilityChange = 'msvisibilitychange';
}else if (typeof document.webkitHidden !== 'undefined'){
hidden = 'webkitHidden';
visibilityChange = 'webkitvisibilitychange';
}
document.addEventListener(visibilityChange, function(){
if(document[hidden]){
stop();
}else{
start();
}
}, false);
}
return {
up: function(){ moveDir('up'); },
down: function(){ moveDir('down'); },
start: start,
stop: stop,
options: s.opts
};
}
// Attach the object to the DOM
$.fn[name] = function(options) {
return this.each(function () {
if (!$.data(this, name)) {
$.data(this, name, new EasyTicker(this, options));
}
});
};
})(jQuery, window, document);