搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

firefox is not scrolling to an #id used as an anchor link, unlike chrome/opera

  • 9 个回答
  • 14 人有此问题
  • 1 次查看
  • 最后回复者为 obliquedaniel

more options

using an anchor link <a href="/path/to/directory/#myanchor">go here</a> on the directory's index.php which has div id="myanchor" I would expect Firefox to scroll to that position on page load. Opera and Chrome both do this, Firefox does not.

Firefox DOES do it if you load the page, THEN click the url bar, and press enter (as if you were reloading the page, but not), at which point firefox properly scrolls to the id anchorpoint. using #id instead of <a name="foo"> has TTBOMK been around for a while, and it's clear that firefox knows what to do with it ultimately. However it should do it on page-load.

using an anchor link <a href="/path/to/directory/#myanchor">go here</a> on the directory's index.php which has div id="myanchor" I would expect Firefox to scroll to that position on page load. Opera and Chrome both do this, Firefox does not. Firefox DOES do it if you load the page, THEN click the url bar, and press enter (as if you were reloading the page, but not), at which point firefox properly scrolls to the id anchorpoint. using #id instead of <a name="foo"> has TTBOMK been around for a while, and it's clear that firefox knows what to do with it ultimately. However it should do it on page-load.

由WebDragon于修改

所有回复 (9)

more options

Hi,

Please check if this happens in a new profile. If the new profile is okay, you can do a Reset Firefox on the old profile via Help > Troubleshooting Information.

Reset Firefox.

more options

Is there any JavaScript involved with creating that anchor?

Is that anchor in an iframe?


Can you post a link to a public page that doesn't require authentication (log in) to access it?

more options

this is a brand new install of Fedora 16, totally clean firefox, barely even used, less than a week old

more options

>Is there any JavaScript involved with creating that anchor? no, they're added manually

> Is that anchor in an iframe?

no, it's in the main body copy

page one has [a href="/pathto/#myanchor"]go to page two index [\a] page two index.php has an [h3 id="myanchor"]

scroll to the anchor fails to happen until you click url bar and press enter again

for a link demonstrating the issue http://w-m-t.com/Products/Oxyguard/#probes

after it fails on page load, click the url bar, and press enter. boom, scrolls straight to the #id

由WebDragon于修改

more options

It looks that some JavaScript is interfering and preventing Firefox to jump to the anchor.
Firefox jumps to the links if I disable JavaScript in the tab and use a left click.

more options

which might be fine as an explanation if it weren't for the damning fact that not only Chrome but also Opera and IE9 handle this just fine. Page validates cleanly as HTML 4.01 Strict. installed Firebug just now, which shows neither errors nor warnings, so no problems with the scripting.

more options

same problem. has anyone found a solution to this?

more options

I have the same problem, although it seems to be associated with my profile only. Is there anyway to correct it without having to reset my profile?

Note: links to tag on same page as source work fine e.g. <a href="#myid">My ID</a>

more options

I have the same problem http://obliqueideas.com/#portfolio

It works in the bio section just above it, but not for the portfolio. Again, if I go to the portfolio page then reload it goes to the right spot.