function release(e) { pressed = false; clearInterval(ticker); if (velocity > 10 || velocity < -10) { target = Math.round(offset + (0.8 * velocity)); target = target > max ? max : target < min ? min : target; amplitude = target - offset; timestamp = Date.now(); requestAnimationFrame(autoScroll); } e.preventDefault(); e.stopPropagation(); return false; }