Created
October 20, 2017 09:15
-
-
Save woosungchu/5fe75c20dbc1ebb405296aa204c59efc to your computer and use it in GitHub Desktop.
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 dfs(depth, x, y){ | |
if(depth == 5)return false; | |
var div = document.createElement('div'); | |
div.style.position = 'absolute'; | |
div.style.left = (x + 100)+'px'; | |
div.style.top = (y + 100)+'px'; | |
div.style.width = (depth * 10)+'px'; | |
div.style.height = (depth * 10)+'px'; | |
div.style.padding = '10px'; | |
div.style.background = '#eee'; | |
document.body.appendChild(div); | |
dfs(depth+1,x,y); | |
console.log(depth,x,y); | |
} | |
document.onmousemove = function(e){ | |
dfs(1,e.pageX,e.pageY); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment