My problem is that I cannot identify and relate the conditions with the touchend event, that is, in the following code fragment 3 ifs are shown, each one represents position