有人知道如何为 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/