码迷,mamicode.com
首页 > Web开发 > 详细

通过js写一个消息弹框

时间:2016-09-03 12:09:56      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:

prompt(data,time) {
        let alertForm = document.createElement(‘div‘);
        alertForm.id="promptBox";
        alertForm.style.position = "fixed";
        alertForm.style.right = "4%";
        alertForm.style.top = "6%";
        alertForm.style.margin = "0 auto";
        alertForm.style.width = "300px";
        alertForm.style.height = "50px";
        alertForm.style.background = "#00bb9c";
        alertForm.style.textAlign = "center";
        alertForm.style.borderRadius = "5px";
        alertForm.style.border = "1px solid #ccc";
        alertForm.style.padding= ‘14px 22px‘;
        alertForm.style.fontSize= ‘14px‘;
        alertForm.style.fontFamily= "微软雅黑";
        alertForm.style.fontWeight= ‘normal‘;
        alertForm.style.color= ‘#fff‘;
        alertForm.style.opacity= ‘.8‘;
        alertForm.style.zIndex = "10001";
        alertForm.innerHTML = data;
        document.getElementsByTagName("body")[0].appendChild(alertForm);
        setTimeout(function(){
            alertForm.style.display = "none";
        },time)
    }

 

通过js写一个消息弹框

标签:

原文地址:http://www.cnblogs.com/baiyygynui/p/5836461.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!