您的位置:首页 > Web前端 > JQuery

一个jQuery的弹窗显示后消失,

2017-09-12 10:28 357 查看
一个这个提示功能的弹出后隐藏,
Alert(pWidth,content);
function Alert(pWidth,content) {
            $("#msg").remove();
            var html ='<div id="msg" style="position:fixed;top:24%;width:100%;height:10px;line-height:30px;margin-top:-15px; z-index: 99999;"><p style="background:#fff;opacity:0.8;width:'+ pWidth +'px;color:#000;text-align:center;padding:5px 5px;margin:0 auto;font-size:12px;border-radius:4px;border: 1px solid #ccc">'+ content +'</p></div>'
            $("body").append(html);
            var t=setTimeout(next,2000);
            function next()
            {
                $("#msg").remove();
            }
        }
pWith是窗口的宽度,content是窗口需要显示的内容,
比如:Alert(1000,"发送验证码成功!");
里面的样式 可以根据

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐