3

My understanding thus far has been that jQuery mobile provides a set of "v" events that mask the difference between touch screen devices and mouse driven devices - i.e. one can pretty much use "v" events equivalents of the traditional event. For instance vclick instead of click.

However, I am starting to suspect that is a rather naive view. With buttons I have been able to bind the vclick event and use it, no issues. But with inputs (radios and checkboxes) it looks like vclick does not fire at all. Am I right about this or is there something else going on? I should mention that I am using jQM 1.2.

I'd much appreciate any help.

Pete D
  • 777
  • 5
  • 15
DroidOS
  • 8,530
  • 16
  • 99
  • 171
  • have you tried the event 'touchstart' ? see also here: http://stackoverflow.com/questions/10165141/jquery-on-and-delegate-doesnt-work-on-ipad/12748593#12748593 – algorhythm Dec 18 '12 at 14:34
  • Thanks so you are suggesting using touchstart in place of click as mentioned in that thread. Does that work equally well on Android devices or is it specific iOS. Also where does vclick fit into it all here? I thought that it was the built in jQuery Mobile virtualization mechanism that took care of everything? – DroidOS Dec 18 '12 at 14:40
  • In my case I just use this solution for Apple mobile devices, cause they have bugs and problems with vclick. My application will never be used on Android therefore I've not tested it yet :-( But look at this point http://stackoverflow.com/a/7530485/655224 – algorhythm Dec 18 '12 at 14:44
  • I've found that sometimes vclick fails for me, so i used click as an alternative, and it sometimes gives me a better result than using vclick. Keep in mind I'm using this for a mobile-only web app. Also, @algorhythm one possible issue with using touchstart is that this will be thrown even if the user wanted to scroll, versus tap the screen (as a click). For mobile, binding onto this event might not be best. – Prusprus Sep 12 '13 at 14:41
  • I am also having the same problem. Click works, vclick does not for radio buttons. I just opened the following bug in JQM github: https://github.com/jquery/jquery-mobile/issues/6512 – kgx Sep 24 '13 at 16:03
  • 1
    VClick is buggy with jQmobile. One solution that works - although I don't understand why is binding to VClick and Click and then adding `event.preventDefault()` as the first line of code. This seems hackish though, and I wouldn't rely on it for anything too important. – dgo Jan 17 '14 at 04:55

0 Answers0