I have an array of ClientRect objects which I got by doing
var trackedElements = $('[track]');
var trackedBounds = [];
_.each(trackedBounds, function(elem) {
return $(elem)[0].getBoundingClientRect();
});
What I also have is another element's bounding client rect.
var currentElement = $('.active')[0].getBoundingClientRect();
My question is, how do I find within trackedBounds
, the closest north of currentElement
?