After updating the data attribute "data-kt-countup-value" via jquery like so:$('#whse_edit_total_sold').attr('data-kt-countup-value', product_data.Total_Sold);
we need to reinitalize the kt-countup so that the counter uses the updated data. Can you advise on how this can be accomplished?
I saw the previous post that suggests:countUp.update(989);
Unfortunately this does not work as countUp is not a function.
We also saw you had suggested to update the count-up settings via the API and linked to the github page. Unfortunately there is no mention of an API on the github doc page.
Thanks for your help,
Ajar
Hi,
You can use the below code to update the value for the count-up by reinstalling the instance with new value "15000":
// On document ready
KTUtil.onDOMContentLoaded(function() {
const count1 = new countUp.CountUp("kt_countup_1", 15000, {prefix: "$"});
count1.start();
});
Worked perfect. Thanks!
Hi ,
Glad to hear that. If you need any further help please let us know.
Regards.