I wrote a small scroller in jquery. The scroller seems to work fine on PC and Mac. However, it does not work on touch devices.
I assume this is due to the mousedown property being called. How can I do this work on both PC and touch screen devices?
thanks
$('.scroll-nav-up, .scroll-nav-down').live('click', function(){ $('.scroller-wrap').stop(); return false; }); $('.scroll-nav-up').live('mousedown', function(){ $(this).closest('.item').find('.scroller-wrap').animate({ top: -($(this).closest('.item').find('.scroller-wrap').height() - 250) }, 800); }); $('.scroll-nav-down').live('mousedown', function(){ $(this).closest('.item').find('.scroller-wrap').animate({ top: 0 }, 800); });
source share