How do I get touch events without big library

ShawnML

New Member
I am using jquery, but I don't want to use jquery mobile, because it is so large, and I don't think I need it. All I am trying to do is get a touch event. This is what I've got.\[code\] $('#menuButton').on('click touchstart', function(){ $('#menu').toggleClass('block') });\[/code\]It only kind-of works, but seems to be firing twice a lot on my phone. I think I should check for both touchstart and touchend somehow. This needs to work on all types of devices, hopefully. Thanks!
 
Top