(JQuery) 在整个历史记录中保存页面状态
我有一个包含电影列表的页面,只要向下滚动,该列表就会扩展。当我单击其中一部电影查看详细信息,然后点击浏览器中的后退按钮时,它忘记了它所处的状态。它使我返回到页面顶部,没有我之前看过的任何扩展电影。
我一直在寻找但找不到正确的答案。我应该怎么做才能让它记住它所处的状态?我知道这可能是带有主题标签的东西?我希望将其保持得尽可能小,因为我已经处理了当前页面内页面的加载。但如果它确实需要插件,那就不是问题了。
I have a page with a movie list, which extends as soon as you scroll down. When I click one of these movies to see the details, and after that hit the back button in my browser, it forgot the state it was in. It returns me back at the top of the page without any extended movies I saw earlier.
I've been searching but couldn't find the right answers. What should I do to make it remember the state it is in? I know it's probably something with hashtags? I would prefer to keep it as minimal as possible since I already took care of the loading of the pages inside the current page. But if it really requires a plugin it's not a problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Ben Alman 的 BBQ 插件 就是这样做的。
Ben Alman’s BBQ plugin does that.
查看 Ben Alman 的哈希更改插件
Check out Ben Alman's hash change plugin