當網頁不在前景時,變更網頁標題
感謝 Geber Lisa 分享,
https://www.brandingmag.com/2015/10/14/what-is-branding-and-why-is-it-important-for-your-business/
這個網頁切換分頁的時候,
他的網頁標題會變成Keep reading,
找了一下,原來是一小段小語法,
透過 visibilitychange 事件的監聽,
document.hidden 是判斷頁面是否隱藏,
觸發要不要切換網頁標題,
挖出來的語法如下
<script> |
參考資料:
本部落格所有文章除特別聲明外,均採用 CC BY-NC-SA 4.0 許可協議。轉載請註明來自 硬碟裡的雜七雜八!