2016-09-24 28 views
2

我有一个哈希代码锚:锚与哈希片段没有导航匹配ID

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

我的网页上再往下我有一个匹配ID的部分:

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

单击链接时,URL会更新,但页面不会移动到该部分。

你可以尝试一下在这里,所有的资产净值项具有哈希片段,并在页面上的每个部分有一个匹配的ID:https://react-test-don.herokuapp.com

为什么点击我的定位标记不做些什么吗?

+1

这似乎相关http://stackoverflow.com/questions/28893855/how-to-use-normal-anchor-links-with-react-router –

+0

可能Pekka,检查出来,也添加到标签“反应-路由器” –

回答

0

为此,我使用

<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 

看看我的网页 - 你应该能够查看源代码,

Here

只是向下滚动到那里说:“在此页”有几个链接带你到页面的不同部分。