Anchor tag doesn't work in iPhone Safari

前端 未结 5 623
一个人的身影
一个人的身影 2020-12-06 18:10

I\'m having an issue with a named anchor tag in iPhone Safari browser. It works well in desktop browsers including Safari, but not working in mobile Safari. Weird!

F

5条回答
  •  太阳男子
    2020-12-06 18:36

    I couldn't get it working with above solutions so hopefully I did my own workaround.

    Purpose: Scroll to anchor "#issues" after navigating to URL "https://example.com/issues/"

    1. Create link "https://example.com/issues?anchor=issues"
    2. On page "https://example.com/issues" add js
       
    

    Voila!

    --

    You can observe that after opening link "https://example.com/issues/#issues" Safari scrolls from anchor to the top of the page, then when you click to edit URL and hit submit button, you will be scrolled to anchor.

    I hope they will fix it fast and after that they will add immediately push notification support.

提交回复
热议问题