»
EnglishFrenchVietnamese

Print - Title Time Script - JavaScriptBank.com

Full version: jsB@nk » Time » Clock » Title Time Script
URL: https://www.javascriptbank.com/title-time-script.html

Title Time Script © JavaScriptBank.comThis script displays the live time in the title of your surfer's browser! It does not erase the default title of the document, but rather, simply appends the time to it. Like the Title date script, the script manipulates the IE 4+ and NS6+ exclusive document.title property, so it's only visible to IE 4+/NS6+ browsers.

Full version: jsB@nk » Time » Clock » Title Time Script
URL: https://www.javascriptbank.com/title-time-script.html



JavaScript
<SCRIPT Language="JavaScript"><!-- Hide/*This script was written by Mike Cullen-mcullen@ameritech.net, 1999*/var scroller;var ampm;var actualtitle=document.title+" "function antiMilitaryTime(){if (hr == "12"){ampm="P.M."}else if (hr == "13"){hr="1"ampm="P.M."}else if (hr == "14"){hr="2"ampm="P.M."}else if (hr == "15"){hr ="3"ampm="P.M."}else if (hr == "16"){hr = "4"ampm="P.M."}else if (hr == "17"){hr = "5"ampm="P.M."}else if (hr == "18"){hr = "6"ampm="P.M."}else if (hr == "19"){hr = "7"ampm="P.M."}else if (hr == "20"){hr = "8"ampm="P.M."}else if (hr == "21"){hr = "9"ampm="P.M."}else if (hr == "22"){hr = "10"ampm="P.M."}else if (hr == "23"){hr = "11"ampm="P.M."}else if (hr == "24"){hr = "12"}}function addZero(){if (min <= "9"){min = "0"+min}if (sec<= "9"){sec = "0"+sec}if (hr <=9){hr = "0"+hr}}function time(){dt=new Date()sec=dt.getSeconds()hr=dt.getHours()ampm="A.M."min=dt.getMinutes()}function scroll() {time()antiMilitaryTime()addZero()var scroller="TIME: "+hr+":"+min+":"+sec+" "+ampmvar timeout=setTimeout("scroll()", 1000)  document.title=scroller+' - ' +actualtitle  }if (document.all||document.getElementById)scroll()//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->