Created
September 24, 2019 07:57
-
-
Save ronaldgreeff/0a38a725e30b43c5e701f0e42629b54d to your computer and use it in GitHub Desktop.
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
elems = document.querySelectorAll('div') | |
l = []; | |
for (var i = 0, len = elems.length; i < len; i++) { | |
if (elems[i].offsetTop != 0) { | |
l.push(elems[i]); | |
}; | |
}; | |
// l.sort((a, b) => ((a.scrollHeight * a.scrollWidth) < (b.scrollHeight * b.scrollWidth)) ? 1 : -1); | |
// for (var i=0, len=l.length; i < len; i++) { | |
// console.log(l[i].offsetTop, l[i].offsetLeft, l[i].offsetHeight, l[i].offsetWidth, l[i]) | |
// }; | |
function f() { | |
for (var i=0, len=elems.length; i<len; i++){ | |
if (elems[i].getBoundingClientRect().y != 0) { | |
return elems[i]; | |
}; | |
}; | |
}; | |
var x = f() | |
var divs = [] | |
for (var i=0, len=x.length; i<len; i++){ | |
if (x[i].nodeName == 'DIV') { | |
divs.push(x[i]) | |
}; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment