There are several div blocks of the same size, located side by side in 2x1, 2x2, 4x4, 5x4 schemes and the like (many surveillance cameras). It is necessary, having captured one block, drag it to another and onmouseup to replace the cameras. But you can not reach the block and release it somewhere at the intersection of other blocks, and then you need to determine the intersection with which of the blocks that the user released the dragged block, the largest, to make a swap of these cameras.
Please tell onmouseup how you can track the position of the dragged element at the moment of onmouseup in relation to other elements. Is the analysis of screen coordinates of elements the only method, or are there simpler and more concise solutions (on pure JS)?