Describe how you would integrate ScrollSpy with a single-page Bootstrap website having multiple sections.

  • Add data-spy="scroll" and data-target to the body element
  • Include scrollspy.js and call the scrollspy function on the body
  • Set data-toggle="scrollspy" on each section's link in the navigation
  • Apply data-spy="scroll" to the navigation bar and set data-target
To integrate ScrollSpy with a single-page Bootstrap website, add data-spy="scroll" and data-target to the body element. This ensures that ScrollSpy is enabled for the entire page, and data-target specifies the navigation bar or menu to be updated. The other options either lack the correct usage or include unnecessary steps for single-page websites.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *