1)ajax开关(默认jquery以ajax方式加载页面)

$.mobile.ajaxEnabled = false;

 

2)不编译指定标签

$.mobile.page.prototype.options.keepNative="input";

 

3)开启dom缓存

$.mobile.page.prototype.options.domCache = true;

 

4)多个页面分开写于不同的html里,在首页用loadPage方法一次性加载其他页面(全部)

$(document).ready(function(){
  $.mobile.loadPage('aaa.html');
  $.mobile.loadPage('bbb.html');
  $.mobile.loadPage('ccc.html');
  $.mobile.loadPage('ddd.html');

});

 

5)当前页面id

$(document).on("pageshow",function(event,data){
  currentPage = data.toPage[0].id;
});

 

6)当前激活页面

$($.mobile.activePage)

 

7)手动操作popup工具(dialog工具也一样是用open和close方法)

//重写默认alert事件
function alert(msg){
  var _popup = $($.mobile.activePage).find('.msg_popup');
  _popup.html('<p>'+msg+'</p>');
  _popup.popup('open');
  window.setTimeout(function(){
    _popup.popup('close');
  },2000);
}

 

8)ajax加载数据后重新宣染 标签

$('#goodslist').html(res).trigger('create');

相关文章:

  • 2021-11-30
  • 2021-12-05
  • 2021-12-18
  • 2021-12-29
  • 2021-12-10
  • 2021-11-19
  • 2021-11-18
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2021-07-21
  • 2022-12-23
  • 2022-03-06
  • 2021-12-04
相关资源
相似解决方案