How to detect when an element over another element in JavaScript?

后端 未结 3 1620
生来不讨喜
生来不讨喜 2021-02-09 01:26

I wrote most of the code... And when the element is \"fully\" over the other element it works. The problem is that I don\'t just want it to be true when the element is \"fully\"

3条回答
  •  眼角桃花
    2021-02-09 01:52

    If you are interested in using jQuery (or if you already are) there are some great collision detection plugins available. Here is a previous answer detailing one https://stackoverflow.com/a/6052254/374866

提交回复
热议问题