ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Net Web >

Add dynamic title to the site

Tuesday on June 2nd, 2020Net Web

Suddenly thought had been to a blog focused on that label when the title is a decent title, but then also to other pages, the page title will become a pile of garbage about, or very Meng Yan text, of course, I have a rough this man, how Meng sister ah comparable to a 2333 so, you will take care of it alive 2333 is a new map.

As for the principle behind it is very simple, even PHP have no need. Not necessarily have to be Typecho, other blog, or just a web page will do. Tags incorporated in the head following code:

script var OriginTitile = document.title; document.addEventListener ( 'visibilitychange', function () {if (document.hidden) {document.title = 'modified herein to the title of the page displayed in the background';} else {document.title = OriginTitile;}});/script

On way to modify it for Typecho and other topics in the blog is modified, usually called modification called "header.php", is responsible for the page header (before the body tag) file can be. And some topics, such as I now use Mirages, provides a way through the set, without modifying the file to be inserted before the head you want to go into the code.

So it is still very easy thing for hexo or similar static blog users also can use, but the content thing. . . I was a little shame. Tell me what you also take the trouble to more than make a suggestion to help me modify it under the 2333

Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: