Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
现在用户点击图像,将手指移开,松开手指并可以看到警报。是否可以检查用户释放手指的位置以及他是否仍在原始图像上以显示他的警报?否则什么都不做。
尝试这个:
var touchedObject; $('body').bind("touchstart", function(e){ touchedObject = $(this); }); $('body').bind("touchend", function(e){ if (touchedObject == $(this)) { //show alert } });