JQTouch - 向前导航而不将页面添加到历史记录

发布于 2024-09-27 02:44:56 字数 535 浏览 0 评论 0原文

如何导航到页面而不将其添加到 JQTouches 内部历史堆栈?

我有类似的东西:

<div id="section1"></div>
<div id="section2"></div>
<div id="section3"></div>

并使用javascript从#section1导航到#section2,

jQT.goTo($('#section2'), 'slide'); //with history tracking

然后使用:然后导航到#section3:

jQT.goTo($('#section3'), 'slide'); //want this to be without history tracking

所以如果我在#section3上有一个后退按钮并单击它,它将带我回到#section1,因为#section2会尚未添加到历史堆栈中。

How can you navigate to a page without adding it to JQTouches internal history stack?

I have something like:

<div id="section1"></div>
<div id="section2"></div>
<div id="section3"></div>

and using javascript I navigate from #section1 to #section2 using:

jQT.goTo($('#section2'), 'slide'); //with history tracking

and then to #section3:

jQT.goTo($('#section3'), 'slide'); //want this to be without history tracking

So if I had a back button on #section3 and clicked it, it would take me back to #section1 because #section2 would not have been added to the history stack.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧情别恋 2024-10-04 02:44:56

我看到了两种可能的解决方案。一是,如果您知道要返回哪个页面,则可以简单地使用公共函数,例如:

jQT.goBack('#section1');

您可以阅读有关 jQT 公共对象的更多信息 此处

如果您想更好地控制历史记录,您可以考虑调整 jQT 库,以便可以访问内部历史记录对象。我必须执行此操作才能查看上一页历史。

I see two possible solutions to this. One is, if you know which page you want to go back to, you could simply use the public function like:

jQT.goBack('#section1');

You can read more about jQT's public objects here.

If you want more control over the history, you might consider tweaking the jQT library so you can access the internal history object. I had to do this to look at the previous page in history.

只等公子 2024-10-04 02:44:56

这样就可以了。
我刚刚添加了这段代码,发现后退按钮不再起作用。

经过进一步调查,没有发现任何历史记录。

jQT.goTo('#accounts', 'flip'); 

This will do it.
I just added this code, and found my back button no longer worked.

after further investigation, no history was captured.

jQT.goTo('#accounts', 'flip'); 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文