mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
smooth article scrolling
This commit is contained in:
parent
4924dcfd12
commit
54cb821ae9
@ -80,8 +80,13 @@ var helperFunctions = {
|
||||
if (!scroll) return
|
||||
|
||||
var height = scroll.getBoundingClientRect().height
|
||||
var newpos = scroll.scrollTop + (height - padding) * direction
|
||||
|
||||
scroll.scrollTop += (height - padding) * direction
|
||||
if (typeof scroll.scrollTo == 'function') {
|
||||
scroll.scrollTo({top: newpos, left: 0, behavior: 'smooth'})
|
||||
} else {
|
||||
scroll.scrollTop = newpos
|
||||
}
|
||||
}
|
||||
}
|
||||
var shortcutFunctions = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user