如何使浏览器的前进和后退的工作在一个单一的页面布局? [英] How to make browser back and forward work on a single page layout?

查看:158
本文介绍了如何使浏览器的前进和后退的工作在一个单一的页面布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为后续问题:<一href=\"http://stackoverflow.com/questions/12221141/most-efficient-way-to-do-a-horizontal-sliding-layout\">Most有效的方式做一个横向滑动的布局,是有可能使用单一的页面布局一样,当使浏览器的前进和后退按钮不起作用?

As a follow-up question to: Most efficient way to do a horizontal sliding layout, is it possible to make the browser's back and forward button work when using a single page layout like that?

推荐答案

您可以使用HTML5历史API来实现这一目标。

You can use the history API in HTML5 to achieve that.

这里有一些资源,让你开始:

Here are a few resources to get you started:

  • http://diveintohtml5.info/history.html
  • http://html5demos.com/history
  • https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history

要获得旧版浏览器的支持,以及有JavaScript库,使是:

To get support in older browsers as well, there are JavaScript libraries that enable that:

  • https://github.com/browserstate/History.js/

高级例如通过Chrome团队,使用历史API:

Advanced example by the Chrome team, that uses the history API:

  • http://www.20thingsilearned.com/en-US

这篇关于如何使浏览器的前进和后退的工作在一个单一的页面布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆