How can you do something like the following?
$('.myDivs').ontouchstart(function(){
alert('touch');
})
the only way I appear to be able to implement touch events is using javascript.. like so
document.getElementById('singleDiv').addEventListener("touchstart",touchHandler, false);
However I would like to implement this to a class, rather than an id… therefore is there a way to do it using jquery like the above example?….
I have found the answer:
$('.myDivs').bind('touchstart', function (event) { alert('touch');});
Kind regards J
As of jQuery 1.4.2, the following works fine for me:
Or for the latest versions of jQuery: