Spaces:
Running
Running
Download tabs.js from wavespeed/wan2.2: direct link, hf CLI and curl.
- Browser
- Download file 654 Bytes
-
https://huggingface.co/spaces/wavespeed/wan2.2/resolve/main/tabs.js
- Command line
-
hf download hf://spaces/wavespeed/wan2.2/tabs.js
-
curl -L -o tabs.js https://huggingface.co/spaces/wavespeed/wan2.2/resolve/main/tabs.js
654 Bytes
| // Code-sample tab switcher. Progressive enhancement: with JS disabled every | |
| // panel except the first stays hidden via the `hidden` attribute in the markup, | |
| // so the page still shows one working example. | |
| document.querySelectorAll(".code-tabs").forEach((tabs) => { | |
| const buttons = [...tabs.querySelectorAll("button")]; | |
| const panels = buttons.map((b) => document.getElementById(b.dataset.panel)); | |
| const select = (i) => { | |
| buttons.forEach((b, j) => b.setAttribute("aria-selected", String(i === j))); | |
| panels.forEach((p, j) => p && (p.hidden = i !== j)); | |
| }; | |
| buttons.forEach((b, i) => b.addEventListener("click", () => select(i))); | |
| select(0); | |
| }); | |