首页 > 代码库 > 通过js写一个消息弹框
通过js写一个消息弹框
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写一个消息弹框
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。