jquery mobile mobileinit事件

来源:互联网 发布:特种兵选吧 知乎 编辑:程序博客网 时间:2024/06/05 16:10

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

         //操作

}); 建议放在jquery.js和jquery.mobile.js之间


mobileinit事件会在jquery mobile框架载入内存之后,UI元素被渲染之前触发,一般是在这时设置全局或部件的默认属性

例如$.mobile.activeBtnClass=""修改按钮被选中时的样式

$.mobile.ns="first"修改命名空间,之后使用就是data-first-role=""

$.mobile.ajaxEnabled=false关闭ajax

$.mobile.loadingMessage="正在加载"  //加载页面时提示

$.mobile.pageLoadErrorMessage="加载出错" //加载错误的提示


页面设置:

$.mobile.page.prototype.options.addBackBtn="true"

$.mobile.page.prototype.options.backBtnTheme="e"

$.mobile.page.prototype.options.headerTheme="b"

$.mobile.page.prototype.options.footerTheme="d"

0 0
原创粉丝点击