Created
November 29, 2017 16:54
-
-
Save Scrumplex/46dd4e41d6b1a41c06b3db379da4eb18 to your computer and use it in GitHub Desktop.
YouTube Clock JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clock() { | |
var time = new Date(), | |
hours = time.getHours(), | |
minutes = time.getMinutes(), | |
seconds = time.getSeconds(); | |
document.querySelectorAll('.clock')[0].innerHTML = harold(hours) + ":" + harold(minutes) + ":" + harold(seconds); | |
function harold(standIn) { | |
if (standIn < 10) { | |
standIn = '0' + standIn | |
} | |
return standIn; | |
} | |
} | |
setInterval(clock, 1000); | |
var clockElem = document.createElement("div"); | |
clockElem.className = "clock"; | |
clockElem.style.fontSize = "2em"; | |
clockElem.style.position = "fixed"; | |
clockElem.style.zIndex = "1000"; | |
clockElem.style.right = "0"; | |
$(".html5-video-container").prepend(clockElem); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment