自定义弹框(手机端),定时消失
//文字弹框,1秒后消失 function txt_layer_glo(txt, time) { var txt_layer = " <p class=\"txt_layer\" style=\"position:fixed;z-index:100;left:10%;top:50%;margin-top:-20px; width:80%;text-align:center;line-height:40px;background-color:rgba(0,0,0,.7);color:#fff;border-radius:4px;\">" + txt + "</p>"; if ($("body .txt_layer").length > 0) { $(".txt_layer").show(); $(".txt_layer").text(txt); } else { $("body").append(txt_layer); } setTimeout(function () { $(".txt_layer").hide() }, time); }