zoukankan      html  css  js  c++  java
  • dialog组件的jquery封装实现

    (function($){    
    
          $.extend({        
    
                 Dialog : function(id, options){            
    
                       var option = $.extend({}, options);            
    
                       option.id = id;
    
                       if(!option.content || option.content == "") {                
    
                                 throw new Error("content不存在!");            
    
                      }
    
                     if(option.content.indexOf("url:") == 0) {                
    
                               url = option.content.replace("url:", "");                
    
                               option.content = "loading...";            
    
                      }           
    
                     var dialog = art.dialog(options);            
    
                    $.Dialog.self = dialog;            
    
                    if(url) {                
    
                                 $.ajax({                    
    
                                       url : url,                   
    
                                       success : function(msg){                       
    
                                       dialog.content(msg);                    
    
                                                                  }               
    
                                            });            
    
                                    }        
    
                            }    
    
                    });
    
                   $.Dialog.prototype = {       
    
                    close : function(){           
    
                               $.Dialog.self.close();       
    
                                            }    
    
                      };
    
                    $.Dialog.constructor = Dialog; })(jQuery);
    

      

  • 相关阅读:
    第二阶段冲刺01
    第十三周进度总结
    单词统计续
    sys模块
    os模块
    random模块
    datetime模块
    time模块
    模块基础
    内置函数
  • 原文地址:https://www.cnblogs.com/zlz-ling/p/4004763.html
Copyright © 2011-2022 走看看