jQuery Mobile - 删除后退按钮,data-nobackbtn 属性不起作用
我有一个简单的 jQueryMobile index.html 页面。其中我有两个使用 data-role="page" 语法的页面。第一页只是一个启动屏幕,几秒钟后会自动更改为第二页。问题是页面从启动页面更改为主页后,后退按钮显示(即使使用 data-nobackbtn="true")。如果我刷新第二页,后退按钮将被隐藏。
我在这里使用两页示例: http:// /jquerymobile.com/demos/1.0a4.1/#docs/pages/docs-pages.html
谢谢
I have a simple jQueryMobile index.html page. Within that I have two pages using the data-role="page" syntax. The first page is just a splash screen which is auto changed to the second page after a few seconds. The problem is after the page changes from the splash to the homepage, the back button shows (even with data-nobackbtn="true"). If I refresh the second page, the back button is hidden.
I'm using the two page example here: http://jquerymobile.com/demos/1.0a4.1/#docs/pages/docs-pages.html
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我成功地使用了以下内容:
它也对您有用吗?
I have used the following with success:
Does it work for you too?
你永远不应该在一个页面中包含另一个页面。每个页面都应该单独声明,如您链接到的两个页面示例所示。
当您说您有index.html页面以及其中的两个页面时,您的意思是index.html只是实际的文件名吗?或者另一个 JQuery Mobile
data-role="page"
元素(后者不会呈现良好)。无论如何,请尝试
data-backbtn="false"
,如上所述,这应该适合您。我从来没有听说过使用data-nobackbtn="true"
,无论如何似乎有点多余,误报很糟糕。You should never have a page, WITHIN another page. Pages should each be declared on their own, as shown in that two page example you linked to.
When you said you have the index.html page, and two pages inside it, do you mean index.html is just the actual file name? Or another JQuery Mobile
data-role="page"
element (the latter won't render nice).Anyways, try
data-backbtn="false"
, as stated above, that should work for you. I never heard of using thedata-nobackbtn="true"
, seems a little redundant anyway, false positives suck.如果您想知道为什么它在新版本中不起作用,那是因为发生了重大更改。如果您使用的是 jQM 1.1.0,请尝试
请注意,它位于页面上而不是标题中,并且属性从 data-backbtn 更改为 data-add-back-btn
If you're wondering why it doesn't work in newer versions it's because of a breaking change. If you're on jQM 1.1.0 try
Please not that it's on the page not in the header and the attribute change from data-backbtn to data-add-back-btn
答案是使用
您可以在
http://mobile.tutsplus.com/tutorials/mobile-web-apps/jquery_android/" rel="nofollow">http:// /mobile.tutsplus.com/tutorials/mobile-web-apps/jquery_android/
The answer is to use
You can check a reference to data-nobackbtn at
http://mobile.tutsplus.com/tutorials/mobile-web-apps/jquery_android/
也许您已经在页面定义中激活了后退按钮:
应该是
Maybe you have activated the back button in the page definition:
shoud be