Skip to content

Instantly share code, notes, and snippets.

View mbohanon's full-sized avatar

Monica Bohanon mbohanon

View GitHub Profile
@mbohanon
mbohanon / animate-browser-title.js
Last active June 16, 2022 19:19
Animate title text when page tab is not active in browser (onblur), this is NOT a marquee. To see example visit http://SHEmedia.us
//Here's an eye catching example to get your visitors back when your web page tab is not active within the browser (onblur). This script will animate the original title text with an intro, the original title text is restored when the tab is returned to active state (focus). When the tab is clicked the original page title is restored. For social media sharing it is highly recommended to include the original page title text with the prefaced animated text (onblur).
//Created by SHEmedia.us
$(function() {
var origTitle, animatedTitle, timer;
function animateTitle(newTitle) {
var currentState = false;
origTitle = document.title; // save original title
@mbohanon
mbohanon / animate-browser-title-loop-through-array.js
Created October 26, 2017 22:12
Loop through array and animate title text when page tab is not active in browser (onblur), this is NOT a marquee.
//Here's an eye catching example to get your visitors back when your web page tab is not active within the browser (onblur). This script will animate the original title text with an intro looping through an array of text, the original title text is restored when the tab is returned to active state (focus). When the tab is clicked the original page title is restored. For social media sharing it is highly recommended to include the original page title text with the prefaced animated text (onblur).
//Created by SHEmedia.us
$(function() {
var origTitle, timer;
function animateTitle(newTitle) {
var currentState = false;
origTitle = document.title; // save original title