Anchor from another page not working in Firefox and IE (works in Chrome)

泄露秘密 提交于 2019-12-11 03:14:27

问题


I've inherited a site with a problem that's driving me nuts in Firefox and IE.

There are 3 anchor tags on the site's home page. All of these anchor tags work when the visitor is on the home page, but only 2 of them work when used from other pages.

The site is http://sm.retriogroup.com

Clicking on "Menus," "Locations" or "Contact" in the header menu brings the page to the right anchor.

If you visit another page such as http://sm.retriogroup.com/gallery and then use the same links, only the "Menus" and "Contact" links work properly. The "Locations" link always goes to the bottom of the home page instead of to the anchor. (In Chrome, the page loads at the correct anchor point)

The HTML for the anchor links is the same, using an ID as the anchor name. I don't understand why this particular one isn't working, while the others do.

Frustratingly, if you use the http://sm.retriogroup.com/#location link from another page, it doesn't work. But then once you're on the home page again and click "Locations," then the anchor loads no problem!


回答1:


Discovered the problem by systematically erasing content on the page one-by-one.

Problem turned out to be related to a slider on the page that was being generated through javascript. Setting a height on the slider's container solved the problem.



来源:https://stackoverflow.com/questions/19611089/anchor-from-another-page-not-working-in-firefox-and-ie-works-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!