Home › Forums › JavaScript › two versions of script on responsive site › Re: two versions of script on responsive site
December 30, 2011 at 9:56 am
#93714
Mottie
Member
Hi Martinthoren!
I’m not sure how you are adding swipe support, but maybe you can just detect if swipe support exists and use it if it does. It is essentially what I did in this blog post on how to add swipe support:
var touch = "ontouchend" in document,
startEvent = (touch) ? 'touchstart' : 'mousedown',
moveEvent = (touch) ? 'touchmove' : 'mousemove',
endEvent = (touch) ? 'touchend' : 'mouseup';
This detection method is from Modernizr which is a better all around method for detecting browser support.