jquery-mobile仍为“无后退按钮"; (测试版2) [英] jquery-mobile still "No Back Button" (Beta 2)

查看:64
本文介绍了jquery-mobile仍为“无后退按钮"; (测试版2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照所有说明操作,以使后退按钮出现,但它不起作用.

I have followed all the instructions to get the back button to appear but it's not working.

这是我关注的内容:

*默认情况下,自动生成的后退"按钮功能处于关闭状态. 要在特定页面上激活自动生成的后退按钮,只需在页面容器中添加data-add-back-btn ="true"属性,魔术就会回来.要全局激活此功能,请将页面插件中的addBackBtn选项设置为true.这是如何设置此示例:

*The auto-generated Back button feature is off by default. To activate auto generated back buttons on specific pages, simply add the data-add-back-btn="true" attribute on the page container and the magic will be back. To activate this globally, set the addBackBtn option in the page plugin to true. Here is an example of how to set this:

 $(document).bind("mobileinit", function() {
          $.mobile.page.prototype.options.addBackBtn = true;
     });

注意:必须先包含此脚本,然后才能在页面顶部引用jQuery Mobile库,此功能才能起作用. mobileinit事件在执行后立即触发,因此您需要在加载jQuery Mobile之前绑定事件处理程序.了解有关设置全局配置选项的更多信息.*

Note: You must include this script before the jQuery Mobile library is referenced in the head of your page for this to work. The mobileinit event is triggered immediately upon execution, so you need to bind event handlers before jQuery Mobile is loaded. Learn more about setting global config options.*

我还清除了缓存,但仍然没有后退按钮...

I've also cleared the cache and I still don't get the back button...

我想念一些新东西吗?

推荐答案

好,我找到了解决方案.

OK I found the solution.

我已决定将其发布在这里,以供可能遇到相同问题的任何人使用.

I've decided to post it here for anyone who might have the same problem.

代码必须改为特定顺序.

The code must be instead in a specific order.

在jquery库之后但在jqm库之前...

After the jquery library but before the jqm library...

请确保此代码段是在jQuery库加载之后但在jQueryMobile库加载之前......:

Make sure that this snippet is AFTER jQuery library loads but BEFORE jQueryMobile library is loaded... so:

<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
 $(document).bind("mobileinit", function() {
   $.mobile.page.prototype.options.addBackBtn = true;
  });
</script>
<script type="text/javascript" src="jquery.mobile-1.0b1.js"></script>

解决方案在这里找到

http://forum.jquery.com/topic/i-need-back-button-back

这篇关于jquery-mobile仍为“无后退按钮"; (测试版2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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