3

I have an anchor with a hash fragment:

<a href="#people">People</a>

Farther down on my page I have a section with a matching ID:

<section id="people">...</section>

When the link is clicked, the URL updates, but the page does not move to the section.

You can try it out here, all the nav items have hash fragments, and each section on the page has a matching ID: https://react-test-don.herokuapp.com

Why does clicking my anchor tag not do anything?

Don P
  • 60,113
  • 114
  • 300
  • 432
  • 1
    This seems related http://stackoverflow.com/questions/28893855/how-to-use-normal-anchor-links-with-react-router – Pekka Sep 24 '16 at 07:25
  • Possibly Pekka, checking it out, also added to the tag "react-router" – Don P Sep 24 '16 at 07:25

1 Answers1

0

For this I use

<a name="subject"></a> - At the position in the page where I want to go
<a href="#subject">Go to subject</a> For the link to jump there

check out my page - you should be able to view source

Here

Just scroll down to where it says 'On this page' there are several links taking you to different sections of the page.

kerry
  • 671
  • 1
  • 5
  • 9