html怎么在alert中加标题,js重写alert事件(避免alert弹框标题出现网址)
js代码:
window.alert = function(msg, callback) {
var div = document.createElement("div");
div.innerHTML = "
+ ".nbaMask { position: fixed; z-index: 1000; top: 0; right: 0; left: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); } "
+ ".nbaMaskTransparent { position: fixed; z-index: 1000; top: 0; right: 0; left: 0; bottom: 0; } "
+ ".nbaDialog { position: fixed; z-index: 5000; width: 80%; max-width: 300px; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); background-color: #fff; text-align: center; border-radius: 8px; overflow: hidden; opacity: 1; color: white; }"
+ ".nbaDialog .nbaDialogHd { padding: .2rem .27rem .08rem .27rem; } "
+ ".nbaDialog .nbaDialogHd .nbaDialogTitle { font-size: 17px; font-weight: 400; } "
+ ".nbaDialog .nbaDialogBd { padding: 0 .27rem; font-size: 15px; line-height: 1.3; word-wrap: break-word; word-break: break-all; color: #000000; } "
+ ".nbaDialog .nbaDialogFt { position: relative; line-height: 48px; font-size: 17px; display: -webkit-box; display: -webkit-flex; display: flex; } "
+ ".nbaDialog .nbaDialogFt:after { content: \" \"; position: absolute; left: 0; top: 0; right: 0; height: 1px; border-top: 1px solid #e6e6e6; color: #e6e6e6; -webkit-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: scaleY(0.5); transform: scaleY(0.5); } "
+ ".nbaDialog .nbaDialogBtn { display: block; -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; color: #09BB07; text-decoration: none; -webkit-tap-highlight-color: transparent; position: relative; margin-bottom: 0; } "
+ ".nbaDialog .nbaDialogBtn:after { content: \" \"; position: absolute; left: 0; top: 0; width: 1px; bottom: 0; border-left: 1px solid #e6e6e6; color: #e6e6e6; -webkit-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: scaleX(0.5); transform: scaleX(0.5); } "
+ ".nbaDialog a { text-decoration: none; -webkit-tap-highlight-color: transparent; }"
+ ""
+ "
+ "
+ "
+ "
+ ""
+ "
"
+ "
"
+ "
+ ""
+ "
"
+ "
+ "确定"
+ "
";
document.body.appendChild(div);
var dialogs2 = document.getElementById("dialogs2");
dialogs2.style.display = 'block';
var dialog_msg2 = document.getElementById("dialog_msg2");
dialog_msg2.innerHTML = msg;
// var dialog_cancel = document.getElementById("dialog_cancel");
// dialog_cancel.onclick = function() {
// dialogs2.style.display = 'none';
// };
var dialog_ok2 = document.getElementById("dialog_ok2");
dialog_ok2.onclick = function() {
dialogs2.style.display = 'none';
callback();
};
};
html引用:
alert.html
This is my HTML page.
alert("哈哈哈!!!看,没有标题~_~");
总结
到此这篇关于js重写alert事件(避免alert弹框标题出现网址)的文章就介绍到这了,更多相关js重写alert事件内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
html怎么在alert中加标题,js重写alert事件(避免alert弹框标题出现网址)相关推荐
- js重写alert事件,避免alert弹框标题出现网址
js代码: window.alert = function(msg, callback) {var div = document.createElement("div");div. ...
- Joomla!程序中加载JS和CSS的方法
1.加载单独的js文件: $js = JURI::base().'components/com_foobar/assets/script.js'; $document =& JFactory: ...
- js:js中加载js文件
这个问题,之前没怎么想过,因为现在大部分时间我们都在搞 react.vue + webpack 这种有模块化的,所以基本上用 es module 就可以. 一般最终形态都是 html 引入 scrip ...
- 在HTML文件中加载js
js加载只分为两种: 1.全局js,放在<head>标签里面,整个页面很多都用到的,它是优先加载的. 2.局部js,放在</html>结束标签以内的任何位置,它是第二加载的. ...
- 中加石墨再冲刺港交所上市:2022年初至今收入为零,陈东尧为CEO
11月18日,中加石墨控股股份有限公司(下称"中加石墨")在港交所递交招股书,准备在港交所主板,宏信为独家保荐人.据贝多财经了解,这是中加石墨第二次递表,此前曾于2022年2月28 ...
- [js点滴]JavaScript事件详解
Event对象 目录 事件是一种异步编程的实现方式,本质上是程序各个组成部分之间的通信.DOM支持大量的事件,本节介绍DOM的事件编程. EventTarget接口 DOM的事件操作(监听和触发),都 ...
- javascript中动态加载js、vbs脚本或者css样式表
目录:DynamicLoad类简介.属性.方法.事件.示例.下载. DynamicLoad类简介 本文将为您介绍一个在javascript中可以动态加载js.vbs脚本和css样式表的DynamicL ...
- jquery中ajax加载js和json文件
全栈工程师开发手册 (作者:栾鹏) jquery系列教程6-AJAX全解 jquery中ajax加载js文件 jquery中ajax加载js文件的函数为getScript() 代码如下: $.getS ...
- python 加载动图_在浏览器中使用TensorFlow.js和Python构建机器学习模型(附代码)...
大数据文摘授权转载自数据派THU 作者:MOHD SANAD ZAKI RIZVI 本文主要介绍了: TensorFlow.js (deeplearn.js)使我们能够在浏览器中构建机器学习和深度学习 ...
最新文章
- Web API With AJAX: Handle Session in Web API
- 【 C 】经典抽象数据类型(ADT)之堆栈(用静态数组实现堆栈)
- python教程怎么抓起数据_介绍python 数据抓取三种方法
- Struts2与Servlet之间的关系
- ServerProperties
- Exchange server 2010系列教程之四 如何卸载exchange server 2010
- 【免费毕设】PHP校园二手信息网站的设计与开发(源代码+论文)
- 将阿拉伯数字转换为语文汉字数字
- 射线 ray linerender spotlight
- easyui打开新的选项卡_easyUI多选项卡后台模板主题_easyUI Tabs选项卡_easyUI模板
- Verilog 7人投票表决器
- 看我如何抓取最新房价数据
- 孙玄/陈东:聊一聊ZooKeeper的顺序一致性
- 服务器pci光卡 系统不显示,工控机系统读取不到PCI卡的原因及解决办法
- 《星际穿越》科学解析
- QSystemTrayIcon退出后系统托盘图标不消失问题
- 为什么要配置Java环境变量以及Java环境变量的配置
- 从四个方向来解读:当下武汉Java开发的就业前景!
- 《JavaWeb从入门到改行》多重外键关系在java中的处理方案
- 使用EA绘制UML状态图