check collision between certain divs?
问题 Anyone know how to check for collision between certain divs? At the moment I'm using getBoundingClientRect() , but it checks for every div: if (this.getBoundingClientRect()) { animateContinue = 1; } How would I go about checking specific ones? Using this for loop I can get the IDs of the divs I want to check. for (var x = 1; x <= noOfBoxArt; x++) { console.log('#boxArt'+x); } 回答1: Okay. Ended up using a modified version of this duplicate. The function which does the work is: var overlaps =