2.默认设置 Configuring defaults
Working with Jquery Mobile's Auto-initialization
不像其他的Jq项目,比如jq和jq ui,Jquery Mobile会在加载到增强特性时马上应用它(远早于document.ready事件发生时)。这些特性会基于Jquery Mobile的默认配置应用,是针对默认的情形设计的,他可能符合你的需求,也可能不符合。幸运的是,它很容易设置
mobileinit事件
当Jquery Mobile开始执行时,他就会在document对象上触发mobileinit 事件,所以你可以绑定别的行为来覆盖默认配置
$(document).bind("mobileinit", function(){//覆盖的代});
<script src="Jquery.js"></script><script src="custom-scripting.js"></script><script src="Jquery-mobile.js"></script>
$(document).bind("mobileinit", function(){ $.extend( $.mobile , { foo: bar });});
$(document).bind("mobileinit", function(){ $.mobile.foo = bar;});
ns (字符, 默认: ""):
subPageUrlKey (字符串,默认: "ui-page"):
nonHistorySelectors (字符串, 默认: "dialog"):
activePageClass (字符串, 默认: "ui-page-active"):
activeBtnClass (字符串, 默认: "ui-page-active"):
ajaxEnabled (布尔值, 默认: true):
ajaxLinksEnabled (布尔值, 默认: true):
ajaxFormsEnabled (布尔值, 默认: true):
hashListeningEnabled (布尔值, 默认: true):
defaultTransition (字符串, 默认: 'slide'):
loadingMessage (字符串, 默认: "loading"):
pageLoadErrorMessage (字符串, 默认: "Error Loading Page"):
gradeA (返回一个布尔值, 默认: 返回$.support.mediaquery的值: