javascript - JQM: Correct touch event to use for navigation, that does not fire on finger scrolling -


i building cordova application.

i have page multiple navigation buttons on (16). nav buttons wrapped 2 buttons per line. causes page scrollable.

i have issue when scroll page finger, button not fires. don't want event firing navigation code when "scroll" page.

i have tried touchstart, touchend , tap. teh docs tap seems looking for, , seem handle scroll better, button stays hi-lited. never fires navigation code.

markup:

<div data-role="navbar">        <ul>                 <li><a href="#">                     <div id="winebutton">                         <img src="images/images/categories/wine.png" style="width: 45px; height: 45px;" /><br />                         wine tasting                     </div>                 </a></li>       </ul> </div> 

js code

        document.getelementbyid('winebutton').addeventlistener('tap', function () {              currentcategory = "wine tasting"             do_nav();          }, false); 

i ended writing own code check screen tap locations on touch start , touch end, , determine if tap or move.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -