Skip to content

Instantly share code, notes, and snippets.

@Ge0rg3
Ge0rg3 / colliding.js
Created December 10, 2018 22:04 — forked from jtsternberg/colliding.js
Detect if two elements are colliding/overlapping
/**
* Detects if two elements are colliding
*
* Credit goes to BC on Stack Overflow, cleaned up a little bit
*
* @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery
* @param $div1
* @param $div2
* @returns {boolean}
*/