You could do something like:
var offset = 100;
$(document.body).find('[offsetTop = '+offset']');
or
var offset = 100;
$("body *").filter(function () {
return this.offsetTop == offset;
});
since you said they're all top level elements, the following should also work:
$(document.body).children().filter(function () {
return this.offsetTop == offset;
});
You can also $(this).offset()
to get the offsets. Using the offsetTop
property only gets the offset from the parent I believe. But it may not matter since they are all top level elements.