I have tried so many variations of fixing this including patched versions of iScroll.js and tracking mouse movement etc. The solution i found was another variation of Henrik Ammer's... adding and removing classes still fires the click event AFTER you remove the class. preventing bubbling with stopPropagation will not work either. The perfect solution to this was by adding removing the class after 200ms. It can probably be less, but that works fine for me.
onScrollMove: function(){ $('a').addClass('scrolling'); },
onScrollEnd: function(e){ setTimeout(canClickNow, 200); function canClickNow(){ $('a').removeClass('scrolling'); } }
The items that get clicked have this event listener:
$('.scroller ul li a').live('mouseup', function(e)
{
if(!$(this).hasClass('scrolling'))
{
// Do stuff
}
});
Or you could do if($(this).hasClass('scrolling')){ e.preventDefault(); } if you are not using custom events on the anchors.