Answers for "javascript make title blink"

0

javascript make title blink

var isOldTitle = true;
var oldTitle = "oldTitle";
var newTitle = "newTitle";
var interval = null;
function changeTitle() {
    document.title = isOldTitle ? oldTitle : newTitle;
    isOldTitle = !isOldTitle;
}
interval = setInterval(changeTitle, 700);

$(window).focus(function () {
    clearInterval(interval);
    $("title").text(oldTitle);
});
Posted by: Guest on July-08-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language