Tagged: animated countdown, enfold, reset
-
AuthorPosts
-
July 16, 2014 at 11:21 am #291994
Hello,
For now it seems that it’s only possible to count up the animated numbers from 0 to the set customized number, but is it also possible to let the animated number countdown, from fror example 10.000 to 8943? So is starts at 10.000 instead of 0. It’s from economic view smarter when people see the prices in that way.
See the private link for the relevant page.
Thanks in advance,
Tim- This topic was modified 10 years, 4 months ago by broodjekaas.
July 16, 2014 at 7:16 pm #292186Hi broodjekaas!
Currently it is not possible. But feel free to request such feature or vote if already requested here – https://kriesi.at/support/enfold-feature-requests/
Best regards,
YigitOctober 29, 2014 at 11:58 pm #343088I love the animated countdown. (and new Enfold updates. It keeps on getting better and better!)
Can a script be added that it restarts every wednesday. We have courses that begin on Wednesday – I’d like to use the countdown to the next time the course begins.
Thank you!
October 31, 2014 at 4:26 pm #344099Hey!
It is possible but unfortunately you are going to need to hire a freelance developer on Envato Studio or Codeable for that kind of customization as it is beyond the scope of support we can provide. You can also request quote from WerkPress.
Please feel free to request such feature as well – https://kriesi.at/support/enfold-feature-requests/Regards,
YigitMarch 23, 2015 at 1:57 pm #416368This reply has been marked as private.March 23, 2015 at 2:38 pm #416380Hi!
Yes, there is Animated Countdown element – http://i.imgur.com/3n5BUPH.png
Please make sure that you are using the latest version of Enfold 3.1.1 – http://kriesi.at/documentation/enfold/updating-your-theme-files/Best regards,
YigitMarch 23, 2015 at 3:46 pm #416417Yigit,
I can only use that one for dates. I wanna show a counter which counts down from 1250 Euro to 750 Euro.
That option is not available is it? If not can I add it somewhere?Envis
March 24, 2015 at 5:15 pm #417187Hey!
I found this, http://codepen.io/shivasurya/pen/FatiB, which may help you out in creating your own.
Best regards,
ElliottDecember 2, 2015 at 4:16 pm #545932@envis, were you able to solve this? I’m looking for the same exact thing and would be interested to know from you if you made it and how.
Thanks.
Antonio
December 2, 2015 at 4:38 pm #545954I had to hire someone, but here is the script. You may be able to work with it. This one restarts every Wednesday.
<!– RESET COUNTDOWN TIMER TO NEXT WEDNESDAY –>
<style>.av-countdown-timer{opacity: 0!important;}</style>
<script>var cday;
var timeInSecs;
var ticker;function getSeconds() {
var now = new Date();
var dy = 3;
var countdowntime = new Date(now.getFullYear(),now.getMonth(),now.getDate(),0,0,0);var nowtime= now.getTime();
var atime = countdowntime.getTime();
var diff = parseInt((atime – nowtime)/1000);
if (diff > 0) {
cday = dy – now.getDay()
} else {
cday = dy – now.getDay() -1
}
if (cday < 0) {
cday += 7;
}
if (diff <= 0) {
diff += (86400 * 7)
}
startTimer (diff);
}function startTimer(secs) {
timeInSecs = parseInt(secs);
ticker = setInterval(“tick()”,1000);
tick();
}function tick() {
var secs = timeInSecs;
if (secs>0) {
timeInSecs–;
} else {
clearInterval(ticker);
getSeconds();
}var days = Math.floor(secs/86400);
secs %= 86400;var hours= Math.floor(secs/3600);
secs %= 3600;var mins = Math.floor(secs/60);
secs %= 60;var p_day = “”
var p_hr = “”
var p_min = “”
var p_sec = “”if (cday != 1) { p_day = “s” }
if (hours != 1) { p_hr = “s” }
if (mins != 1) { p_min = “s” }
if (secs != 1) { p_sec = “s” }//var result = cday + ‘ day’ + p_day + ‘ ‘;
//result += hours + ‘ hour’ + p_hr + ‘ ‘ + mins + ‘ minute’ + p_min + ‘ ‘ + secs + ‘ second’ + p_sec;
// document.getElementById(“countdown”).innerHTML = result;
jQuery(‘.av-countdown-days .av-countdown-time’).html(cday);
jQuery(‘.av-countdown-hours .av-countdown-time’).html(hours);
jQuery(‘.av-countdown-minutes .av-countdown-time’).html(mins);
jQuery(‘.av-countdown-seconds .av-countdown-time’).html(secs);
jQuery(‘.av-countdown-timer’).css(‘opacity’, ‘1!important’);
jQuery(‘.av-countdown-timer’).attr(‘style’,’opacity:1!important’);}
// LOAD DIFFERENT IMAGES AS BACKGROUND FOR COUNTER
jQuery(document).ready(function() {
jQuery(‘.av-countdown-days .av-countdown-time’).html(”);getSeconds();
//jQuery(‘.av-countdown-timer’).css(‘display’, ‘block’);
});
</script>December 2, 2015 at 4:47 pm #545957Hi @Wildwood, thank you for sharing the code with everyone for that time related countdown timer.
I actually addressed @envis to see if he was able to solve what he said in the message above (quote: “I wanna show a counter which counts down from 1250 Euro to 750 Euro.”), which is what I was looking for.
I’ll try see if I can somehow contact him privately – not sure this is possible here (and it wouldn’t actually be the reason to have a support forum like this awesome one;))
Antonio
December 4, 2015 at 3:19 pm #547027Hi!
you guys could email each others. Simply click on “Send E-Mail” below profile picture.
Cheers!
AndyMarch 31, 2017 at 8:51 am #769787Thanks mate!
In which file do you put the code?
And does anyone know how to rewrite it, so it automatically refreshes every time the counter hits 00?
Thanks!
April 5, 2017 at 6:14 am #772213Hi,
@lauritschristensen: The script should go inside an external js file or use the wp_footer hook.Best regards,
IsmaelApril 5, 2017 at 9:46 am #772349Thanks Ismael,
However, I am no coding genius, so if you could explain a bit further that’d be highly appreciated!
I.e.
1. Create “animated-countdown-looper.js”
2. Place in “/correct-folder
3. Do this voodoo magicHaha, sorry for being a noob man.
Cheers,
April 7, 2017 at 3:36 am #773643Hey!
Instead of the external file, try this hook in the functions.php file.
// https://pastebin.com/9PqwShF0
Please contact the script author for more info.
Regards,
IsmaelApril 7, 2017 at 7:27 am #773728Thanks Ismael!
Now, where do I add the code?
I tried to read about hooks on Google, but seemed very confusing.
Something like:
1. Create .module file (i.e. countdown_reset.module)
2. Create .info file (i.e. countdown_reset.info)
3. Place in /modules folder (exactly where in the directory? i.e. /wp-content/themes/enfold/includes/modules)I am just very uncertain what files to create, where to place them and how they will connect to the Animated Countdown
I highly appreciate all your help!
April 9, 2017 at 8:35 am #774813Hi!
The code should go in the functions.php file. I didn’t test it personally though. Please contact the plugin or script author for more info.
Best regards,
IsmaelApril 10, 2017 at 12:54 pm #775426Thanks Ismael.
Unfortunately, it didn’t do the trick.
To give you more insight:
The countdown is for a product offer.I’d ultimately like to simply be able to set the timer at i.e. 1 hour, 23 min., 12 sec., and always have it begin there when the page is reloaded.
April 11, 2017 at 5:14 am #775775Hi!
If you want to reset the countdown to 1 hour, 23 min, 12 seconds every time the page reload, you can try this in the functions.php file:
function ava_custom_script_fix(){ ?> <script> (function($){ function a() { $('.av-countdown-timer').each(function() { var d = new Date(); $(this).data('day', d.getDate()); $(this).data('hour', d.getHours() + 1); $(this).data('minute', d.getMinutes() + 23); $(this).data('second', d.getSeconds() + 12); }); } a(); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_script_fix');
Don’t forget to remove the first modification.
Cheers!
IsmaelApril 11, 2017 at 12:43 pm #775972You, Ismael, have deserve a nice big cold beer!
It worked!
Thank you so much mate!
HOWEVER!
Add the code to the “enfold-functions.php” and not “functions.php”.
April 13, 2017 at 11:21 am #777176Hey!
Glad we could help. Please note that this will affect every timer in the site so you have to turn on the custom css class field if you want to use it for a specific timer.
// http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/
Cheers!
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.