jQuery mobile

来源:互联网 发布:ubuntu kylin 安装jdk 编辑:程序博客网 时间:2024/06/05 22:45

一、data-XXX

  1. data-role

    data-role="page"  整个页面data-role="header"  头部data-role="content"  内容data-role="footer"  尾部
  2. data-position

    data-position="fixed" 固定头部和底部
  3. data-transition 页面的跳转动画
  4. data-ajax 页面跳转是否使用Ajax载入,默认为true
  5. data-prefetch 页面是否启用预加载特性,默认为false

二、方法

  1. jQuery.event.special.orientationchange.orientation() 获取设备的方向
  2. $.mobile.ajaxEnable = false; 所有链接默认都不是用Ajax加载,除非你把某个a元素的data-ajax属性设置为true
  3. $.mobile.changePage(跳转页面, 参数) 跳转页面
  4. $.mobile.activePage 能够知道jQuery Mobile正在显示哪个页

三、事件

  1. jQuery mobile 生成页面后调用 $(document).bind('pageinit', function () {内容});
  2. 设备屏幕方向改变后调用 $(window).bind('orientationchange', function(event){内容});
  3. mobile初始化完成后执行,用来修改mobile的默认值 $(document).bind('mobileinit', function(){内容});
0 0