Current Path : /storage/v11800/affypharma/public_html/wp-content/plugins/auxin-pro-tools/public/assets/js/src/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/affypharma/public_html/wp-content/plugins/auxin-pro-tools/public/assets/js/src/module.protools.js |
;(function($){
// on document ready
$(function(){
// Auxin Countdown Element
$.fn.AuxinCountDown = function(){
var $wrapper = $(this).find('.aux-countdown-wrapper '),
data = {
year : $wrapper.data('countdown-year'),
month : $wrapper.data('countdown-month'),
day : $wrapper.data('countdown-day'),
hour : $wrapper.data('countdown-hour'),
min : $wrapper.data('countdown-min'),
sec : $wrapper.data('countdown-sec')
},
targetDate = new Date(data.year,data.month,data.day,data.hour,data.min,data.sec);
$year = $wrapper.find('.aux-countdown-year'),
$month = $wrapper.find('.aux-countdown-month'),
$day = $wrapper.find('.aux-countdown-day'),
$hour = $wrapper.find('.aux-countdown-hour'),
$min = $wrapper.find('.aux-countdown-min'),
$sec = $wrapper.find('.aux-countdown-sec');
setInterval( function(){
var diffTime = ( Date.parse(targetDate) - Date.parse(new Date() ) ) / 1000;
if ( diffTime < 0 ) return;
$year.text( Math.floor( diffTime / ( 31536000 ) ) ); // 1 year = 3153600 second
$month.text( Math.floor( ( diffTime / 2592000 ) % 12 ) ); // 1 month = 2592000 second
$day.text( Math.floor( ( diffTime / 86400 ) % 365 ) ); // 1 day = 86400 second
$hour.text( Math.floor( ( diffTime / 3600 ) % 24 ) ); // 1 hour = 3600 second
$min.text( Math.floor( ( diffTime / 60 ) % 60 ) ); // 1 min = 60 second
$sec.text( Math.floor( ( diffTime ) % 60 ) );
},1000 )
}
$('.aux-widget-countdown').each(function(){
$(this).AuxinCountDown();
});
});
})(jQuery);