Scrollspy problem

Scrollspy problem
0.0 0

#1

Hello!

I would be very happy if someone could help.
Scrollspy doesn’t seem to work, although I think I used all the required parts. The navigation bar works, it links to the section. Just the Scrollspy stays inactive.

  <body data-spy="scroll" data-target=".navbar" data-offset="50">
    
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
      <div class="navbar-header">
        <a class="navbar-brand" href="#">Aron Geber</a>
      </div>
      <div>
        <ul class="nav navbar-nav navbar-right col-md-4">
          <li class="active"><a href="#section1">ABOUT</a></li>
          <li><a href="#section2">PORTFOLIO</a></li>
          <li><a href="#section3">CONTACT</a></li>
        </ul>
      </div>
      </div>
    </nav>
      <div id="section1">
        <h2 class="text-center">ABOUT</h2>
        <p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
      </div>
      <div id="section2">
        <h2 class="text-center">PORTFOLIO</h2>
        <p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
      </div>
      <div id="section3">
        <h2 class="text-center">CONTACT ME</h2>
        <p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
      </div>
      </body>
Aron &#169 2017. All Rights Reserved

#2

It works. Perhaps you didn’t include jquery ?


#3

I didn’t try jquery. Should I add it in the JS library?
I am doing this project in codepen, when I scroll to the different sections it doesn’t show it on the navbar.


#4

Include jquery first,
bootstrap.js second

that’s how it shall work.


#5

Thank you, it works now!