我想“影片化”瀏覽器選項卡中的頁面標題,以每秒在兩種狀態之間交替,如下例所示:
- 頁面標題
- ? 頁面標題
我怎樣才能做到這一點?
謝謝!
uj5u.com熱心網友回復:
您可以執行以下操作:
const star = "? ";
setInterval(() => {
if (!document.title.startsWith(star))
document.title = star document.title;
else
document.title = document.title.replace(star, '');
}, 1000)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/467531.html
上一篇:如果容器正在使用`display:flex`,如何在`div`中將行移到列
下一篇:適合其容器保留大小比例的影像
