Collision Class
Detects collisions between a DOM element against other DOM elements or Coords objects.
Constructor
Collision
(
Object
-
el
-
colliders
-
[options]
Parameters:
-
el
HTMLElementThe jQuery wrapped HTMLElement.
-
colliders
HTMLElement | 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
collider
is overlapped. -
[on_overlap_stop]
Function optionalExecutes a function when a
collider
is no longer collided. -
[on_overlap]
Function optionalExecutes a function when the mouse is moved during the collision.
-
Returns:
Object:
Collision instance.