I have the following behaviour: (it is reproducible, and I tried different ways of implementation with the same results):
I have implemented two very basic functions recognizing leftswipe and rightswipe. both functions simple do an output to the console for now.
The behaviour I have is that only every second swipe in the same direction produces an output.
So I added functions for the events tap, taphold, vmouseup, vmousedown, vmouseout, vmousecancel.
Everything seems to be behaving normal but for one interesting point (omitting all but the swipe outputs):
I swipe right, no output, swipe right, swipe RIGHT output, swipe right, no output, swipe right, swipe LEFT output, swipe right, no output, swipe right, swipe RIGHT output.
If I do the same with swiping left, I only get every second or third swipe RIGHT output, all others are simply no output.
The environment I am using: JQM 1.4.5; jquey 1.10.2, cordova 4.1.2, developing against galaxy nexus on android 4.4.4
this is my html header:
- <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
- <script type="text/javascript" src="js/swipe.js"></script>
- <script type="text/javascript" src="js/jquery.mobile-1.4.5.min.js"></script>
this the code segment in swipe.js:
- $(document).bind("mobileinit", function() {
- $(document).on('swiperight', 'div.ALMainPage', function() {
- // Do something when the user swipes right on the page
- var $page = $(this); // It's convenient to have this in a variable
- if (ALerror) console.error('swipeRight');
- });
-
- $(document).on('swipeleft', 'div.ALMainPage', function() {
- // Do something when the user swipes left on the page
- var $page = $(this); // It's convenient to have this in a variable
- if (ALerror) console.error('swipeLeft');
- });
I have verified that the "swipe" function works on my phone correctly (ruling out android, screen, I/O) by trying the swipe navigation example on the demo webpage.
I'd appreciate if you could give me an idea what to try to narrow down the issue. I assume it is some form of conflicting event in my code.
Let me know if you need more info or if I can try something else.