react-scrollspy icon indicating copy to clipboard operation
react-scrollspy copied to clipboard

Why does the titles in the nav bar don't get highlighted ?

Open aziz-boudi4 opened this issue 8 years ago • 4 comments

I have one issue and one question :

Issue: The titles in my nav bar are not being highlighted once I scroll to a specific "Section"

Question: When I tap on a specific nav bar title, the scrollspy works fine and goes to the clicked section, but my question is :

  • instead of jumping right away to the clicked section, can it instead scroll down and not jump directly to the selected html section ?

aziz-boudi4 avatar Sep 18 '16 02:09 aziz-boudi4

@aziz-boudi4 Sorry for the late reply.

The titles in my nav bar are not being highlighted once I scroll to a specific "Section"

Could you be more specific?

instead of jumping right away to the clicked section, can it instead scroll down and not jump directly to the selected html section ?

No, at least for now. Jumping directory to the selected section is the bahavior of HTML internal link, not by JavaScript.

makotot avatar Sep 30 '16 16:09 makotot

@makotot Thanks for replying. Let's say I have 5 sections, would it be possible to highlight the section's title in my nav bar when I'm in the appropriate section ?

  • I am using a sticky div that is fixed to the top of the screen and it contains my nav bar with all the sections titles.
  • Is it possible to highlight the title or change its color when the user is seeing the appropriate section.
  • Example: If I'm seeing section2 on my screen, can section title become highlighted ?

aziz-boudi4 avatar Sep 30 '16 18:09 aziz-boudi4

@aziz-boudi4 Hmm, could you show me an example code ? or is it public on github ? I cannot reproduce it.

makotot avatar Oct 01 '16 00:10 makotot

add the following css: html { scroll-behavior: smooth; }

bethwickerson avatar Mar 03 '20 20:03 bethwickerson