jquery.vloading.js 1005 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Vue-jQuery-Amaze Loading插件
  3. *
  4. * 2015-12-15
  5. */
  6. ;(function($) {
  7. $.extend({
  8. vloading: function(opt) {
  9. if (typeof(v_loading) == 'undefined') {
  10. var _html = '<div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="vloading">';
  11. _html += '<div class="am-modal-dialog">';
  12. _html += '<div class="am-modal-hd">正在载入</div>';
  13. _html += '<div class="am-modal-bd">';
  14. _html += '<span class="am-icon-spinner am-icon-spin"></span>';
  15. _html += '</div></div></div>';
  16. $('body').append(_html);
  17. v_loading = $('#vloading');
  18. }
  19. if (opt == 'open' || typeof(opt) == 'undefined') {
  20. v_loading.modal('open');
  21. } else if(opt == 'close') {
  22. v_loading.modal('close');
  23. } else {
  24. return true;
  25. }
  26. }
  27. })
  28. })(jQuery);