手机移动端alert替换方案
//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(); }; }());
会饮酒时为伴侣,再逢天下平.