Has anyone figured out how to make the title of the content stick at the top, one below the other, as the user scrolls? I've been using Bootstrap's Scrollspy
, which works fine, but I need a few additional features. You can check out the codepen link here. (I didn't include the code in the SO editor because it shows a mobile view.)
- Currently, there are 2 titles displayed on the screen - one inside the Navbar and the other within the content.
- The titles should stick one below the other, resembling an index of the page.
- When a user clicks on any of the titles, the page should smoothly scroll to that specific content (I know this is achievable with
Scrollspy
, but only the title with the.active
class is highlighted).
I understand that writing custom JS for this may take some time (which I would prefer not to do). I've tried searching online, but most plugins available are similar to Scrollspy.
I'm open to using any plugin that offers this feature, or even simple modifications to the existing Scrollspy
would be fine with me.