搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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

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.