flipdown icon indicating copy to clipboard operation
flipdown copied to clipboard

Tearing down the javascript

Open ykamin-booth opened this issue 3 years ago • 1 comments

Hi, what's the best way to tear down a flipdown instance? I don't see a function that does so.

ykamin-booth avatar Nov 30 '21 01:11 ykamin-booth

For anyone looking for this in future, here's how you can do it.

// Clear FlipDown's internal interval
clearInterval(flipdown.countdown);
// Remove all generated elements inside the FlipDown container
document.getElementById("flipdown").replaceChildren();

After doing this, you can construct a new instance of FlipDown.

PButcher avatar Oct 25 '22 23:10 PButcher