How to disable timeline and clock after cesium initiated?

When I initialize the Cesium viewer, I set the animation: true and timeline: true. Is it possible after cesium has initialized to “disable”/“destroy” the clock and timeline?
I tried adding a button where the onclick event does:

viewer.timeline = false;

viewer.animation = false;

Though that does not do anything,

Hello,

It is not possible to destroy the widgets after they’ve been created, but you can hide them from the UI using CSS styling. Here is an example:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

viewer.animation.container.style.visibility = ‘hidden’;
viewer.timeline.container.style.visibility = ‘hidden’;
viewer.forceResize();

``

Best,

Hannah