0

I have structure

<div>
  <ul>
    <li><a></a></li>
    <li><a></a></li>
    <li><a></a></li>
  </ul>
</div>

I have created sliding for iphone/ipad, I set the overflow:hidden on DIV and move UL up and down

The problem is that when I start touchstart event, by puting my finger on a link <a></a> and moving my finger up and down for slide, after sliding is done the location of the page is changed, the link click worked... I need to prevent that

I want to change the location of the page only and only when touchend is occured just after touchstart, no touchmove between them...

Give me advises please, Thank you

ArmeniaH
  • 733
  • 1
  • 8
  • 18

1 Answers1

0
inner_container.bind('touchstart', function(e) {
//e.preventDefault();
   .... 
});

inner_container.on('click', 'a', function(e) {
  if(touch_moving){
    touch_moving = 0;
    return false;
  }
});

inner_container.bind('touchmove', function(e) {
  touch_moving = 1;
  ...
});

Notice that in touchstart default is not prevented !

ArmeniaH
  • 733
  • 1
  • 8
  • 18