Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #16108
Closed
Open
Issue created Mar 19, 2015 by Administrator@rootContributor

Feature request: make ScrollSpy's use of offset() or position() configurable.

Created by: jcheroske

I have a situation where, due to the use of absolute and relative positioning, as well as translateZ() and scale(), jquery's position() is returning 0. Because the data-spy="scroll"element is not the <body>, scrollspy.js is using position() and not offset(). Commenting out the following from scrollspy.js:

    if (!$.isWindow(this.$scrollElement[0])) {
      offsetMethod = 'position'
      offsetBase   = this.$scrollElement.scrollTop()
    }

restores perfect behavior. I would like to see a scrollspy option that allows the use of either offset() or position() to be forced. (I know the offset/position thing has come up multiple times. Sorry if I'm stirring up old wounds.)

Assignee
Assign to
Time tracking