简体   繁体   English

命名锚链接在dojo对话框中不起作用(chrome和firefox)

[英]Named anchor links not working inside dojo dialog (chrome and firefox)

I have a problem with with named quick links eg 我对命名快速链接有疑问,例如

<a href="#bottom">Jump to bottom</a>
    ....load of content.....
<a name="bottom"></a>

not working correctly when inside a dojo dialog 在dojo对话框中时无法正常工作

The links do not work in firefox at all. 链接根本无法在Firefox中使用。 They do work in internet explorer. 他们确实在Internet Explorer中工作。 They work in chrome if the parent page is scrolled to the bottom. 如果将父页面滚动到底部,它们将在chrome中工作。 If the parent page is not scrolled to the bottom then clicking the link in the dialog scrolls the parent page by an amount, continually clicking the link keeps scrolling the parent page until it reaches the bottom, at which point the link within the dialog works. 如果父页面未滚动到底部,则单击对话框中的链接将使父页面滚动一定数量,不断单击该链接将继续滚动父页面直到其到达底部,此时对话框中的链接将起作用。

here is a jsfiddle . 这是一个jsfiddle

Can anyone suggest what the issue is, or a possible solution? 任何人都可以提出问题的根源或解决方案吗?

Thanks in advance 提前致谢

It seems that Google Chrome has a problem with your anchor being the last thing on the pane. 看来Google Chrome浏览器有问题,您的锚点是窗格中的最后一件事。 If you change your HTML to be: 如果将HTML更改为:

<a href="#bottom">Jump to bottom</a>
....load of content.....
<a name="bottom"></a>Some random character

It works fine on Chrome (35.0.1916.153). 在Chrome(35.0.1916.153)上运行良好。 To provide a clean solution the best thing is to add a simple space on the end of your HTML, for example: 为了提供一个干净的解决方案,最好的办法是在HTML的末尾添加一个简单的空格,例如:

<a href="#bottom">Jump to bottom</a>
....load of content.....
<a name="bottom"></a>&nbsp;

This seems to work just fine, as you can see in your update JSFiddle: http://jsfiddle.net/QWEzC/123/ 正如您在更新JSFiddle中所看到的那样,这似乎工作得很好: http : //jsfiddle.net/QWEzC/123/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM