Leandro Berg
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [CBX Flexible Countdown] Callback on finishHey Sabuj hello,
okay, until you do release that feature, maybe people can use my simple solution to achieve that.
Best.
Forum: Plugins
In reply to: [CBX Flexible Countdown] Callback on finishFollow here my solution for this problem using the circular countdown (just remove the “type circular” option on PHP hook to apply the solution to all type of counters:
PHP HOOK (functions.php)
add_action('cbfccountdown_after_display', function($attr, $index){ if($attr['type'] != 'circular') return; if($index != 1) return; wp_enqueue_script('countdown-after-finish', get_template_directory_uri() . '/js/countdown-after-finish.js', [], false, true); }, 99, 2);JS CODE (countdown-after-finish.js)
(() => { let d = document; let el = d.querySelector("#cbfc-circular-countdown1"); const observer = new MutationObserver(() => { let finished = true; el.querySelectorAll(".cbfc-circular-val").forEach(el => { if(el.innerHTML != 0) finished = false; }); if(!finished) return; // do something here }); observer.observe(el, {subtree: true, childList: true}); })();- This reply was modified 5 years, 2 months ago by Leandro Berg.
- This reply was modified 5 years, 2 months ago by Leandro Berg.
- This reply was modified 5 years, 2 months ago by Leandro Berg.
- This reply was modified 5 years, 2 months ago by Leandro Berg.
Viewing 2 replies - 1 through 2 (of 2 total)