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
  • #15882
Closed
Open
Issue created Feb 24, 2015 by Administrator@rootContributor

scrollspy problem with two navs

Created by: devniel

Hi, it seems that scrollspy goes crazy with two navs targeting same elements, I have this approach because of responsive design, one navigation menu is hidden in certain dimensions.

Demo : http://jsbin.com/xowuw/1/

By now, my workaround is a simple filter in scrollspy.js' refresh method :

       var exists = false;

        for(var i in self.targets){
          console.log(self.targets[i], " == ", this[1]);

          if(self.targets[i] == this[1]){
            exists = true;
            break;
          }
        }

        if(!exists){
          self.offsets.push(this[0])
          self.targets.push(this[1])
        }

Thanks !

Assignee
Assign to
Time tracking