-
Notifications
You must be signed in to change notification settings - Fork 2.4k
.click() event does not work on latest jqm on touchscreen device (tested on iOS) #1857
Comments
I wrote a demo: Using alpha 4: Using latest: |
I think if you need to catch a touch/click event before our ajax handling gets to it, you'll need to bind to the vclick event, which is what we use to normalize tap and click handling across devices. Will that work for you? |
$('#foo').live("pageshow", function() { Set a whitescreen (the page does not load). The page does load with .click(). Using $(document).ready(function(){ does not work as well. This is a demo: |
Using .tap() makes it work with touchscreen devices, but does not work on chrome. If vclick is the normalized tap/click handling, then why does .click() works on alpha 4? |
Actually, vclick isn't defined as a plugin, just an event (we can consider adding that).
Let me know if this helps! |
I'm working on this now. Can you explain how you're using click for me? Thanks! |
Please grab latest and retest. If you need to bind logic to click, you may need to disable the new useFastClick option, depending on what you're trying to do. That said, I'm not sure the code example above is exactly how we'd recommend doing it. You might have better luck scoping a live click event to the page you're referring to, so that it isn't re-called every pageshow. Pagecreate can help there too. Also, try delegating off the body to catch a click early, regardless of the setting above. |
Thanks, .bind('vclick') seems to work. I am using pagecreate however on some pages I would need to attach a click event to generated content so therefore I would need to use pageshow. Regarding usage I need to add extra behaviour when its clicked (passing variables) and also prevent a link from changing pages (intercepting, e.g. for javascript commands such as manipulating google map -- I just added return false; to my code). I am not really sure what do you mean by delegating off the body. Do you mean putting the script on head? |
Using JQM latest and JQuery 1.6.1, click() event binded to hyperlink does not work on touch screen devices. JQM alpha 4.1 works well.
The text was updated successfully, but these errors were encountered: