码迷,mamicode.com
首页 > Web开发 > 详细

dialog组件的jquery封装实现

时间:2014-10-03 12:13:24      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:io   os   ar   sp   art   c   on   cti   log   

(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);

dialog组件的jquery封装实现

标签:io   os   ar   sp   art   c   on   cti   log   

原文地址:http://www.cnblogs.com/zlz-ling/p/4004763.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!