سؤال

I am working on an app in which i have 5 images and i want to get the Id of the image when touchstart event begins because i want to move those images to a certain position. I am using javascript.

هل كانت مفيدة؟

المحلول

If you use jQuery, and provided that you have touchstart event bound to image

$('img').bind('touchstart', function() {
    var imageId = this.id;    
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top