android - Touch events double firing on Safari for iOS -


we have webapp built using bootstrap, angular, , mongodb run on nodejs express. there image on 1 part of site responds touch or mouse events on image. there javascript functions called each time touch (or mouse click) begins , ends. code implementing is:

            <div class="visible-sm visible-md visible-lg">                 <div class="col-xs-4 nopadding">                     <p class="noheightgap">                     <a class="img-responsive">                         <img id="1" onmousedown="beginclick(event);" onmouseup="endclick(event);"                              ontouchstart="begintouch(event);" ontouchend="endtouch(event);" src="../public/img/custom-1.png" class="img-responsive img-rounded">                     </a>                     </p>                 </div>             </div> 

this code works expected on desktop browsers have tested, on android chrome browser. however, using safari on iphone, or dolphin hd browser on android, seems ontouchstart , ontouchend methods both fired twice touches. (touches last longer) never see more 2 sets of these events fired. in cases, using

event.preventdefault();  

to prevent rogue events firing. there causing touch events fired multiple times on safari on iphone , dolphin on android?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -