介绍

  当jQuery Mobile通过Ajax加载内容或用于自定义通知时,会显示一个小的加载叠加层。

标准loader

  $( document ).on( "click", ".show-page-loading-msg", function() {
        var $this = $( this ),
          theme = $this.jqmData( "theme" ) || $.mobile.loader.prototype.options.theme,
          msgText = $this.jqmData( "msgtext" ) || $.mobile.loader.prototype.options.text,
          textVisible = $this.jqmData( "textvisible" ) || $.mobile.loader.prototype.options.textVisible,
          textonly = !!$this.jqmData( "textonly" );
          html = $this.jqmData( "html" ) || "";
       $.mobile.loading( "show", {
              text: msgText,
              textVisible: textVisible,
              theme: theme,
              textonly: textonly,
              html: html
      });
  })
  .on( "click", ".hide-page-loading-msg", function() {
        $.mobile.loading( "hide" );
  });

  <button class="show-page-loading-msg" data-textonly="false" data-textvisible="false" data-msgtext="" data-inline="true">Icon (default)</button>
  <button class="show-page-loading-msg" data-textonly="false" data-textvisible="true" data-msgtext="" data-inline="true">Icon + text</button>
  <button class="show-page-loading-msg" data-textonly="true" data-textvisible="true" data-msgtext="Text only loader" data-inline="true">Text only</button>
  <button class="hide-page-loading-msg" data-inline="true" data-icon="delete">Hide</button>

自定义loader

  <button class="show-page-loading-msg" data-theme="b" data-textonly="true" data-textvisible="true" data-msgtext="Custom Loader" data-inline="true" data-html="<span class="ui-bar ui-shadow ui-overlay-d ui-corner-all"><img src="../_assets/img/jquery-logo.png"><h2>is loading for you ...</h2></span>" data-iconpos="right">Custom HTML</button>
  <button class="hide-page-loading-msg" data-inline="true" data-icon="delete">Hide</button>

最新文章

  1. c#自定义日志记录
  2. MVC区域使用
  3. System call in linux by C
  4. cocos2dx建立项目
  5. 微软职位内部推荐-Software Engineer II-Office Incubation
  6. Android 程序框架设计
  7. MFC控件(15):Tooltip
  8. jQery的链式操作和商城简易导航栏
  9. C# winform中Show()和ShowDialog()的区别
  10. 关于 Mybatis 设置懒加载无效的问题
  11. 关于sha1加密与md5加密
  12. speech
  13. Mac中selenium使用出现错误
  14. PHP中多个文件包含的问题 (二)
  15. git push以后GitHub上文件夹灰色 不可点击
  16. 书记查询的App设计
  17. qt 提高图片加载速度
  18. 分享至微信、QQ、微博、复制链接
  19. Java中&amp;、|、&amp;&amp;、||详解
  20. ROW_NUMBER() OVER(PARTITION BY)

热门文章

  1. FastDFS 初始
  2. url规范化:解决从baidu.com到www.baidu.com的
  3. ZT 父子进程共享文件描述符
  4. fstat、stat和lstat 区别(转)
  5. RPMForge介绍及安装
  6. 【转】Android Activity原理以及其子类描述,androidactivity
  7. idea + maven + webapp 项目搭建
  8. Android学习笔记_81_Android ProgressDialog ProgressBar 各种效果
  9. HDFS副本存放读取
  10. MVC5 数据注解和验证