![](/img/trans.png)
[英]Change content of title tag, when switching to other open tab in the browser
[英]How to change and blink the title of the browser when the user goes to other tab or minimizes the browser?
我想知道如何更改瀏覽器的標題,並在用戶打開另一個選項卡或只是最小化瀏覽器時將其設置為閃爍的文本。
對於閃爍標題:
var title = document.title;
var intv = window.setInterval(function () {
document.title = document.title === '' ? title : '';
}, 500);
// call this to stop the blinking
function stopBlink() {
window.clearInterval(intv);
document.title = title;
}
至於在Tab切換或最小化上執行它, 可能在window.onblur
上運行代碼可以工作,但我猜它不能完成。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.