Created
July 2, 2018 18:23
-
-
Save rpaskin/909017333400ae720a985219269525df to your computer and use it in GitHub Desktop.
JS Bin Jogo de Trollagem // source http://jsbin.com/galijep
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Jogo de Trollagem"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
#myBtn{ | |
position:absolute; | |
top:40%; | |
left:40%; | |
} | |
</style> | |
</head> | |
<body> | |
<button id='myBtn'> | |
Clique me | |
</button> | |
<script id="jsbin-javascript"> | |
var btn=document.getElementById("myBtn"); | |
btn.onclick= function(){ | |
alert('win'); | |
} | |
btn.onmouseover= function(){ | |
var intervalo= setTimeout(frame, 100) | |
function frame(){ | |
btn.style.top= Math.random()*100+"%"; | |
btn.style.left=Math.random()*100+"%"; | |
} | |
} | |
</script> | |
<script id="jsbin-source-css" type="text/css">#myBtn{ | |
position:absolute; | |
top:40%; | |
left:40%; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var btn=document.getElementById("myBtn"); | |
btn.onclick= function(){ | |
alert('win'); | |
} | |
btn.onmouseover= function(){ | |
var intervalo= setTimeout(frame, 100) | |
function frame(){ | |
btn.style.top= Math.random()*100+"%"; | |
btn.style.left=Math.random()*100+"%"; | |
} | |
}</script></body> | |
</html> |
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
#myBtn{ | |
position:absolute; | |
top:40%; | |
left:40%; | |
} |
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
var btn=document.getElementById("myBtn"); | |
btn.onclick= function(){ | |
alert('win'); | |
} | |
btn.onmouseover= function(){ | |
var intervalo= setTimeout(frame, 100) | |
function frame(){ | |
btn.style.top= Math.random()*100+"%"; | |
btn.style.left=Math.random()*100+"%"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment