Crossing over to new elements during touchmove

后端 未结 3 699
独厮守ぢ
独厮守ぢ 2020-12-08 10:27

I\'d like to make it so that as you drag your finger over a set of elements, the background of the one you\'ve got your finger on changes.

It seems like I want to u

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 11:16

    You can't "trigger a touchend event" or cancel touches, which you would need to start touching another.

    So you would be better off binding the touchmove event to the container, and manipulating the boxes based on their position/sizes and the touch position, like what part of Dan Lee's answer does.

提交回复
热议问题