do two DOM elements overlap?
function intersection(elementA, elementB){
var a = elementA.getBoundingClientRect(),
b = elementB.getBoundingClientRect();
var overlap = (a.left <= b.right &&
b.left <= a.right &&
a.top <= b.bottom &&
b.top <= a.bottom);
return overlap;
}