smooth article scrolling
This commit is contained in:
parent
4924dcfd12
commit
54cb821ae9
1 changed files with 6 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue