logo Lee Johnson SEO

Meta Title onVisibility Change to Phone Number

To see the following code in action look at the browser tab at: lee-johnson.com. It presents my phone number so that the potential client see's my phone number rotating in the the browser tab.

<script>// CALL: 07809 765635 meta title
function onVisibilityChange(){isPageVisible=!document.hidden}function updateTitle(){document.title=isPageVisible?faces[++counter%faces.length]:title}
var title=document.title,counter=-1,faces=["<-CALL: 07809 765635->","<CALL: 07809 765635-->","<-CALL: 07809 765635->","<--CALL: 07809 765635>"],interval=window.chrome?500:500,isPageVisible=!0;setInterval(updateTitle,interval),document.addEventListener("visibilitychange",onVisibilityChange,!1),updateTitle();</script>