Created
January 23, 2015 09:07
-
-
Save PsHegger/733c2c074e2401e4cb5f to your computer and use it in GitHub Desktop.
Flying eagle
This file contains hidden or 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 pinterIstvan() { | |
var sasDiv = document.getElementById("sasDiv"); | |
if (!sasDiv) { | |
sasDiv = document.createElement("div"); | |
sasDiv.setAttribute("id", "sasDiv"); | |
sasDiv.style.position = "fixed"; | |
sasDiv.style.zIndex = "99999999"; | |
var sasImg = document.createElement("img"); | |
sasImg.src = "https://i.imgur.com/cGCBuxM.gif"; | |
sasDiv.appendChild(sasImg); | |
var sasCopyright = document.createElement("div"); | |
sasCopyright.innerHTML = "Image by István Pintér"; | |
sasCopyright.style.color = "transparent"; | |
sasDiv.appendChild(sasCopyright); | |
var body = document.body; | |
body.insertBefore(sasDiv, body.childNodes[0]); | |
} | |
var lft = -sasDiv.offsetWidth; | |
var moveSas = function() { | |
lft += 5; | |
if (lft > document.body.clientWidth) lft = -sasDiv.offsetWidth; | |
sasDiv.style.left = lft + "px"; | |
requestAnimationFrame(moveSas); | |
} | |
requestAnimationFrame(moveSas); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment