autoUpdate([interval]), cancelAutoUpdate()
Start or stop periodic re-rendering from JavaScript, the counterpart of the auto:update attribute.
Syntax
- doodle.autoUpdate([interval])
- doodle.cancelAutoUpdate()
- interval
- A number of milliseconds, or a string with
ms,sorm. Default2000, minimum500.
Calling autoUpdate() again restarts the timer with the new interval.
cancelAutoUpdate() stops it and removes the auto:update attribute if present.
Examples
const doodle = document.querySelector('css-doodle');
doodle.autoUpdate('3s');
// later
doodle.cancelAutoUpdate();