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 } });