//新建提示 function createTips(text,fn){ var tips = $("<div></div>"); var box = $("<div></div>"); box.css({"position": "absolute","top": "50%","left":"50%","-webkit-transform": "translate3d(-50%,-50%,0)","transform": "translate3d(-50%,-50%,0)","text-align": "center","background": "rgba(0,0,0,0.8)","border-radius": "8px","padding":"12px 20px"}); var p = $("<p></p>"); p.html(text); p.css({"height": "24px","line-height": "24px","font-size": "14px","color":"#fff","white-space" : "nowrap"}); box.append(p); tips.append(box); tips.css({"position":"fixed","width": "100%","height": "100%","top": "0","left": "0","background-color": "rgba(0,0,0,0.0)","z-index":"9999999"}); $(document.body).append(tips); tips.animate({opacity:1},500,"swing",function(){ $(this).delay(500).fadeOut(500,function(){ $(this).remove(); fn && fn(); }); }); }