Home Website Building Knowledge Standard Post

Standard Post

Add specific text title display to inactive website tabs

Well, the effect can be seen on the Naibabiji tag page. If there is no effect, it may be because I removed the code, so check the demo image below. The specific code is as follows, which can be added to your theme's header.php or footer.php. <script> jQuery(...

Updated on November 1, 2019 About 1 minute read
给网站标签页非活动状态添加特定文字的标题显示

Well, you can refer to the Naibabiji tab page for the effect. If there is no effect, it might be because I removed the code, so just look at the demo image below.

change-page-title-browser-focus-using-jquery

The specific code is as follows, you can add it to your theme's header.php or footer.php.

<script>
   jQuery(function() {
   var pageTitle = jQuery(document).find("title").text();
   jQuery(window).blur(function() {
     jQuery("title").text("哎呀,标签崩溃了... :)");  // 这里自己修改内容
   });
   jQuery(window).focus(function() {
     jQuery("title").text(pageTitle);
   });
});
</script>
5/5 - (1 vote)
Previous Disable WordPress's Default Feature of Generating Responsive Images Continue reading content around the same timeline. Next Tips and Precautions for Beginners Applying for Website Domain Names View the next related tutorial or experience.

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: