JQTouch - 向前导航而不将页面添加到历史记录
如何导航到页面而不将其添加到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我看到了两种可能的解决方案。一是,如果您知道要返回哪个页面,则可以简单地使用公共函数,例如:
您可以阅读有关 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:
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.
这样就可以了。
我刚刚添加了这段代码,发现后退按钮不再起作用。
经过进一步调查,没有发现任何历史记录。
This will do it.
I just added this code, and found my back button no longer worked.
after further investigation, no history was captured.