Skip to content

Commit

Permalink
experimenting with configs
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSot committed Jun 4, 2021
1 parent 97090ed commit a93ae7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/src/scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DATA_API_KEY = '.data-api'

const Default = {
target: null,
rootMargin: '10px 0px 10px 0px'
rootMargin: '0px 0px -50%'
}

const DefaultType = {
Expand Down Expand Up @@ -180,7 +180,7 @@ class ScrollSpy extends BaseComponent {
const entry = entries
.filter(el => el.isIntersecting)
.sort((a, b) => (a.intersectionRect.height - b.intersectionRect.height))
.pop()
.shift()

if (entry) {
this._activate(this._targets.find(el => el.hash === `#${entry.target.id}`))
Expand Down

0 comments on commit a93ae7e

Please sign in to comment.