Advertisement
PsHegger

Flying Eagle

Jan 22nd, 2015
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function pinterIstvan() {
  2.     var sasDiv = document.getElementById("sasDiv");
  3.  
  4.     if (!sasDiv) {
  5.         sasDiv = document.createElement("div");
  6.         sasDiv.setAttribute("id", "sasDiv");
  7.         sasDiv.style.position = "fixed";
  8.         sasDiv.style.zIndex = "99999999";
  9.  
  10.         var sasImg = document.createElement("img");
  11.         sasImg.src = "https://i.imgur.com/cGCBuxM.gif";
  12.  
  13.         sasDiv.appendChild(sasImg);
  14.  
  15.         var sasCopyright = document.createElement("div");
  16.         sasCopyright.innerHTML = "Made by István Pintér";
  17.         sasCopyright.style.color = "transparent";
  18.  
  19.         sasDiv.appendChild(sasCopyright);
  20.  
  21.         var body = document.body;
  22.  
  23.         body.insertBefore(sasDiv, body.childNodes[0]);
  24.     }
  25.  
  26.     var lft = -sasDiv.offsetWidth;
  27.     var moveSas = function() {
  28.         lft += 5;
  29.  
  30.         if (lft > document.body.clientWidth) lft = -sasDiv.offsetWidth;
  31.  
  32.         sasDiv.style.left = lft + "px";
  33.         requestAnimationFrame(moveSas);
  34.     }
  35.  
  36.     requestAnimationFrame(moveSas);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement