Capítulo 224 de 411
Static helper that tests whether one object overlaps another (or the pointer), by a configurable overlap threshold.
| Parameter | Type | Description |
|---|---|---|
| testObject | Object | element, mouse/touch event (with pageX/pageY), selector string, or {top,left,right,bottom} rect |
| threshold | Number | String | default 0 (any overlap); a pixel count, or a percentage string like "50%" of overlapping area |
Returns: Boolean.
if (Draggable.hitTest("#dropzone", "50%")) {
// dragged element overlaps the dropzone by at least 50%
}
onDragEnd.hitTest() to decide whether a drop was successful.