Dragging one image makes other image to drag

前端 未结 5 419
谎友^
谎友^ 2021-01-21 10:12

When i drag the right part of uploaded image in mask1 , than uploaded image in mask2 is dragging, but that should\'t happen....

Here is video link

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 11:03

    Why are you defining the ondragover attribute twice? In any case, after defining onDragOverSec, you are later rewriting it as onDragOver, thereby triggering the event handler that you are using for the first element.

    As a side note, this code could be rewritten to be be more DRY, by passing the differences between the two cases as variables to the same function, rather than two copies of each function

提交回复
热议问题