$(document).ready(function () { if(typeof Step3 != 'undefined'){ Step3.select('.payment_mode:not(.simple)').each(function () { $(this).find('h4').click(function () { var paymentMode = $(this).parent(); var paymentModeBody = $(this).siblings('.payment_body'); $('.payment_body').not(paymentModeBody).slideUp(); $('.payment_body').not(paymentModeBody).parent('.payment_mode').removeClass('active'); console.log(paymentModeBody) }); }); } $('#scode').attr('placeholder','CVV'); /* donations counter */ if ( Number.isInteger(parseInt(campaign_stats.sum)) ) { var collected = parseInt(campaign_stats.sum) / 100; }else { var collected = 0; } console.log('collected :'+collected); collected += 1196009; console.log('collected 2 :'+collected); var startCounter = parseInt(collected) - 30000; var donorsCount = campaign_stats.count; if( context_lang == 'fr_FR'){ $('#logo').after('
\
\

Déjà 0 collectés, merci !

\
\
\
'); } if( context_lang == 'en_EN'){ $('#logo').after('
\
\

0 raised, thank you!

\
\
\
'); } $('#logo').after(''); $('#logo').after(''); (function($) { $.fn.countTo = function(options) { // merge the default plugin settings with the custom options options = $.extend({}, $.fn.countTo.defaults, options || {}); // how many times to update the value, and how much to increment the value on each update var loops = Math.ceil(options.speed / options.refreshInterval); //increment = (options.to - options.from) / loops; //var increment = incrementVal[Math.floor(Math.random() * incrementVal.length)]; //console.log('increment = '+increment); return $(this).each(function() { var _this = this, loopCount = 0, value = options.from, interval = setInterval(updateTimer, options.refreshInterval); function updateTimer() { // random increment from array value value += options.incrementVal[Math.floor(Math.random() * options.incrementVal.length)]; loopCount++; $(_this).html(value.toFixed(options.decimals)); if (typeof(options.onUpdate) == 'function') { options.onUpdate.call(_this, value); } if (loopCount >= loops || value >= options.to) { clearInterval(interval); value = options.to; if (typeof(options.onComplete) == 'function') { options.onComplete.call(_this, value); } } } }); }; $.fn.countTo.defaults = { from: 0, // the number the element should start at to: 100, // the number the element should end at incrementVal: [50, 75, 100, 200, 500], speed: 1000, // how long it should take to count between the target numbers refreshInterval: 4500, // how often the element should be updated decimals: 0, // the number of decimal places to show onUpdate: null, // callback method for every time the element is updated, onComplete: null, // callback method for when the element finishes updating }; })(jQuery); jQuery(function($) { $('#widget_progress_bar .collected_amount').countTo({ from: startCounter, to: collected, incrementVal: [50, 75, 100, 200, 500], speed: 60000, refreshInterval: 1000, onComplete: function(value) { console.debug(this); } }); }); /* donations counter END*/ /* help */ $('#footer').prepend('\ \ '); $('#footer .help').click(function(){ if( context_lang == 'fr_FR'){ Swal.fire({ title: 'Notre service donateurs à votre disposition', text: 'Pour toute demande ou information, n’hésitez pas à contacter notre équipe par email à donateurs@fdf.org ou par téléphone au 01.44.21.87.00.' }) } if( context_lang == 'en_EN'){ Swal.fire({ title: 'Our donor service at your disposal', text: 'For any request or information, do not hesitate to contact our team by email at donateurs@fdf.org or by phone at 01.44.21.87.00.' }) } }) /* help END*/ /* socials share $('#form-info').append('
\
\ \ \ \ \ \
\
'); */ /* socials share END */ /* hashtags $('#form-info').prepend('

#EnsemblePourNosSoignants

'); hashtags END*/ /* footer */ /* custom annexes*/ $('#copyright a').each(function(){ var thishref = $(this).attr('href'); $(this).attr('href', thishref+'?cid=458'); $(this).attr('target', '_blank'); }) $('#copyright p').append('| Protection de vos données'); });