setInterval(function(){var last=null; Array.prototype.forEach.call(
Last active
August 29, 2015 14:18
-
-
Save ypetya/11c2285800033d2c8ef6 to your computer and use it in GitHub Desktop.
JS Tweaks / Bookmarks
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
javascript:(function loadThings(){ var script = document.createElement('script'); script.src=window.prompt('Enter script path to load'); document.body.appendChild(script);})() |
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
(function checkTree(callbackFn){ | |
function visit(node, nth){ | |
if(callbackFn(node)) { | |
return false; | |
} | |
if(node.hasChildNodes()){ | |
return expand(node.childNodes); | |
} | |
return true; | |
} | |
function expand(nodeList){ | |
for(var i=0;i<nodeList.length;i++){ | |
if(!visit(nodeList[i])) break; | |
} | |
} | |
visit(document); | |
}( | |
function(node) { | |
if($(node).position().x < 0){ | |
console.info(node); | |
return 'stop'; | |
} | |
} | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment