Since you're saying you've tried a few ways, and you're just looking for something more elegant, I'll assume you have the offset part worked out, and I'll just go with offset
myself. Modify that part as needed. For elegance, you could create a custom selector checking top offset:
$.expr[':'].above = function(obj, index, meta, stack) {
return $(obj).offset().top < meta[3];
}
You could then query it as such:
$('#myParentDiv').find('div:above(100)').css('background-color', 'red');
Of course this could just as well have been expressed as
$('#myParentDiv div:above(100)').css('background-color', 'red');
or, as pointed out in comments
var y = 100;
$('#myParentDiv div:above('+y+')').css('background-color', 'red');