Introduction to HitboxJS
Javascript library to detect collisions between DOM Elements
What is HitboxJS ?
HitboxJS is a JS library that can help you detect collisions or intersections between elements in your DOM.
It can be used if your are building complex interfaces with, for example, rectangle selection, or if you're building a game*.
*If you are building a game, you are probably using a canvas so this library is not for you (and if not, maybe you should consider switching to canvas for performance reasons). HitboxJS only detects collisions and intersection between DOM Elements.
HitboxJS watches your elements and fires an event when two elements collide.
If you want to give it a try you can first install the library.
Getting startedLast updated
Was this helpful?