Function: onFullscreenChange()
ts
function onFullscreenChange(callback): () => void;Registers a callback that fires whenever the document enters or exits fullscreen mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (isFull) => void | Called with true when entering fullscreen, false when exiting. |
Returns
A cleanup function that removes the listener.
() => void
Example
ts
const off = onFullscreenChange((isFull) => console.log(isFull))
off() // remove listenerSince
1.0.0