How it's done

This effect is achieved by adding a javascript in the <head> section of your theme.

The script is as follows:

<!-- Text inactive tab -->
<script>jQuery(document).ready(function( $ ){
// Get page title
var pageTitle = $("title").text();
// Change page title on blur
$(window).blur(function() {
$("title").text("Come back!");
});
// Change page title back on focus
$(window).focus(function() {
$("title").text(pageTitle);
});
});
</script>

You can copy the entire code and paste it as is in the <head> section.


Next: How to edit the text



Join the Discussion
Write something…
Recent messages
Nick-at-WA Premium
I like this, thanks Jorn!
Reply
JHaugland Premium
Thanks
Reply
suzieq Premium
This is awesome, thanks!!
~Suzanne
Reply
JHaugland Premium
Thank you as well
Reply
Cynthiah1 Premium
Pretty cool.
Reply
JHaugland Premium
Thanks
Reply
Loes Premium
Great little script, I love it
Reply
JHaugland Premium
Thanks
Reply
AlanJE Premium Plus
That would be great to have such interaction, thanks for the training Jorn, Best Alan
Reply
JHaugland Premium
Thank you
Reply
Top