Collision Class
Detects collisions between a DOM element against other DOM elements or Coords objects.
Constructor
Collision
(
Object
-
el -
colliders -
[options]
Parameters:
-
elHTMLElementThe jQuery wrapped HTMLElement.
-
collidersHTMLElement | ArrayCan be a jQuery collection of HTMLElements or an Array of Coords instances.
-
[options]Object optionalAn Object with all options you want to overwrite:
-
[overlapping_region]String optionalDetermines when collision is valid, depending on the overlapped area. Values can be: 'N', 'S', 'W', 'E', 'C' or 'all'. Default is 'C'.
-
[on_overlap_start]Function optionalExecutes a function the first time each
collideris overlapped. -
[on_overlap_stop]Function optionalExecutes a function when a
collideris no longer collided. -
[on_overlap]Function optionalExecutes a function when the mouse is moved during the collision.
-
Returns:
Object:
Collision instance.