jQuery Mobile,allowSamePageTransition不能多次转换到同一页面 [英] jQuery Mobile, allowSamePageTransition can't transition to same page more than once

查看:73
本文介绍了jQuery Mobile,allowSamePageTransition不能多次转换到同一页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery Mobile构建应用程序.我正在处理的页面从服务器加载内容,并在过渡到该页面之前更新DOM.

I'm building an app using jQuery Mobile. The page I'm working on loads content from server and updates the DOM before transitioning to that page.

虽然这不是应用程序,但我在此简单页面中隔离了该问题,删除了所有ajax调用以及所有其他javascript和html:简单页面

While this is not the app, I've isolated the problem in this simplistic page removing all ajax calls an all other javascript and html: Simplstic page

所需的行为:它应该加载第2页,然后在单击第2页上的链接时一次又一次过渡到第2页.如果我没有记错的话,这就是allowSamePageTransition属性的用途.

The desired behaviour: it should load page 2 and then upon clicking the link on page 2 transition to page 2 again and again. This is what the allowSamePageTransition property is for if I'm not mistaken.

其实际行为方式:第1页上的链接转换为第2页,然后第2页上的链接再次转换为第2页,但随后我无法单击任何元素顶部似乎是身体.

The way it actually behaves: The link on page 1 transitions to page 2, then the link on page 2 transitions to page 2 again, but then I can't click on anything, the element on top seems to be the body.

我已经设置好页面,因此您可以将源代码复制到编辑器中并尝试使用,而无需修改任何链接.

I've set the page up so you can just copy the source into an editior and try it out without modifying any links.

是我做错了还是这是一个错误,如果我错过了文档中的某些内容,请向我指出.我以前有这种机制可以工作,但现在我不知道为什么最简单的示例无法正常工作.

Am I doing something wrong or is this a bug, if I've missed something in the docs, please point it out to me. I've gotten this kind of mechanism to work before but right now I can't figure out why the simpest example won't work properly.

推荐答案

不完全支持相同的页面转换.我在"A"和相同的"B"页面,然后在它们之间来回过渡.

Same Page Transitions are not fully supported. I have had good luck with "A" & "B" pages that are identical and then transition back and forth between them.

http://jquerymobile.com/demos/1.2. 0/docs/pages/page-transitions.html

使用同一页面过渡

默认情况下,将忽略到当前活动页面的转换,但可以使用$ .mobile.changePage方法的allowSamePageTransition选项启用该转换. 请注意,并非所有转换都可以按预期进行,并且可能会导致不切实际的结果.

Transitions to the current active page are ignored by default but can be enabled by using the allowSamePageTransition option of the $.mobile.changePage method. Note that not all transitions will work as expected and may end in an impractical result.

这篇关于jQuery Mobile,allowSamePageTransition不能多次转换到同一页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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