search

Home  >  Q&A  >  body text

javascript - H5 page positioning problem

I have such a need, and I don’t have any ideas. Let me see if any friends can provide it:

Background:
An H5 list page. The list content is stores one by one. This page is long. When you click on one of the stores, you will jump (window.document.href=store url) to the store's detailed page. Click return (browser return) again to return to this list page.

Requirement:
Can it be possible to scroll to a certain store, click to display the detail page and then return to this position, instead of returning to the top again.

I thought about using anchor points, but anchor points only allow users to locate a specific location through the URL. There are no other ideas, so I would like to ask everyone for help. Thank you.

高洛峰高洛峰2769 days ago468

reply all(3)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-19 10:16:26

    Save scrollTop to localStorage when jumping

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-19 10:16:26

    You can get the value of scrollTop() before jumping and save it. When returning, set scrollTop() to this value
    http://www.w3school.com.cn/ti...
    Official demo:

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-19 10:16:26

    Thank you. But I don’t plan to use jq for the time being.

    reply
    0
  • Cancelreply