javascript - JQuery Mobile 默认数据主题

标签 javascript mobile themes jquery-mobile

有人知道如何为 jquery-mobile 设置默认数据主题吗?

看起来有必要为每个组件设置数据主题。

即使您为页面数据 Angular 色设置数据主题,加载的列表和其他组件也不会遵守它。

我是否遗漏了手册的某些页面?

最佳答案

就像 Joel 所说,你必须覆盖默认值。目前看来也没有其他办法了。

采用 Joel 的示例代码:

<script src="jquery.js"></script>
<script src="custom-scripting.js"></script>
<script src="jquery-mobile.js"></script>

自定义您的 custom-scripting.js

这是一个示例代码,其中还有一些您可以配置的选项:

$(document).bind("mobileinit", function () {

    // Navigation
    $.mobile.page.prototype.options.backBtnText = "Go back";
    $.mobile.page.prototype.options.addBackBtn      = true;
    $.mobile.page.prototype.options.backBtnTheme    = "d";

    // Page
    $.mobile.page.prototype.options.headerTheme = "a";  // Page header only
    $.mobile.page.prototype.options.contentTheme    = "c";
    $.mobile.page.prototype.options.footerTheme = "a";

    // Listviews
    $.mobile.listview.prototype.options.headerTheme = "a";  // Header for nested lists
    $.mobile.listview.prototype.options.theme           = "c";  // List items / content
    $.mobile.listview.prototype.options.dividerTheme    = "d";  // List divider

    $.mobile.listview.prototype.options.splitTheme   = "c";
    $.mobile.listview.prototype.options.countTheme   = "c";
    $.mobile.listview.prototype.options.filterTheme = "c";
    $.mobile.listview.prototype.options.filterPlaceholder = "Filter data...";
});

还应该有其他选项,例如:

$.mobile.dialog.prototype.options.theme
$.mobile.selectmenu.prototype.options.menuPageTheme
$.mobile.selectmenu.prototype.options.overlayTheme

您也许可以在此处找到更多设置: http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.js

关于javascript - JQuery Mobile 默认数据主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4891906/

相关文章:

javascript - 如何从地址获取经度和纬度

php - 在 wordpress 的子主题 functions.php 中禁用主题功能

javascript - 将 TypeScript 转换为 JavaScript

javascript - 无法在 Angular 2 组件中连接字符串

javascript - 使用 TypeScript 扩展 JS Date 但 "this"关键字无法正常工作

javascript - 从由下划线分隔的文本中获取特定字符串

html - 如何在手机上使用最小宽度?

twitter-bootstrap - 您使用哪种用于移动/桌面的 Bootstrap 3 网格模式?

javascript - 如何使用 JavaScript 检测移动设备?

jquery - 尝试在 jquery-ui 作用域容器中使用非作用域 jqueryui 小部件