//alert ;(function () { var AlertBox = function (options){ this.defaults = { title:"", callback:null }, this.options = $.extend({}, this.defaults, options); }; AlertBox.prototype = { constructor: AlertBox, init:function(){ var teml = ""; teml=teml+‘<div id="alertbox">‘; teml=teml+‘ <p id="msgA">‘+this.options.title+‘</p>‘; teml=teml+‘</div>‘; if($("#alertbox").length===0){ $("body").append(teml); }else{ $("#alertbox>#msgA").html(this.options.title); } $("#alertbox").stop(1,1).fadeIn(); setTimeout(function (){ $("#alertbox").stop(1,1).fadeOut(); }, 2000); if(typeof (this.options.callback)=="function"){ this.options.callback(); } } }; $.AlertBox=function(options){ var alertBox = new AlertBox(options); return alertBox.init(); }; }());
时间: 2024-09-29 23:12:31