Speed up smooth scrolling a bit

pull/427/merge
Thibaut Courouble 9 years ago
parent 925217f924
commit 29829ac1ce

@ -234,13 +234,13 @@ $.smoothScroll = (el, end) ->
if smoothScroll if smoothScroll
newDistance = smoothEnd - smoothStart newDistance = smoothEnd - smoothStart
smoothDuration += Math.min 400, Math.abs(smoothDistance - newDistance) smoothDuration += Math.min 300, Math.abs(smoothDistance - newDistance)
smoothDistance = newDistance smoothDistance = newDistance
return return
smoothStart = el.scrollTop smoothStart = el.scrollTop
smoothDistance = smoothEnd - smoothStart smoothDistance = smoothEnd - smoothStart
smoothDuration = Math.min 400, Math.abs(smoothDistance) smoothDuration = Math.min 300, Math.abs(smoothDistance)
startTime = Date.now() startTime = Date.now()
smoothScroll = -> smoothScroll = ->

Loading…
Cancel
Save