Come Back Window Tab

grey.png

Step One

From your Squarespace account, go to Code Injection: Settings > Advanced > Code Injection

Step Two

Copy and paste the code below into the Header Code Injection box.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

Next, copy and paste the code below into the Footer Code Injection box.

<script>
$(function() {
    // Get page title
    var pageTitle = $("title").text();

    // Change page title on blur
    $(window).blur(function() {
      $("title").text("Hey, Come Back");
    });

    // Change page title back on focus
    $(window).focus(function() {
      $("title").text(pageTitle);
    });
});
</script>

Step Three

Change the Hey, Come Back text to whatever you’d like. Have fun with it by adding emojis. 😄 🥑 🎉

Make sure you do not delete the quotation “ “ marks around the text.

Save and refresh the page. 👍

Moov Labs