提示框

简介: 1 DOCTYPE html> 2 3 4 提示框 5 6 #pop{width: 400px;border: 1px solid #666;margin: 100px auto 0px;border-radius: 8px;} 7 #pop .
 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <title>提示框</title>
 5         <style type="text/css">
 6         #pop{width: 400px;border: 1px solid #666;margin: 100px auto 0px;border-radius: 8px;}
 7         #pop .title{height: 40px;line-height: 40px;overflow: hidden;border-bottom: 1px solid #666;}
 8         #close{float: right;}
 9         #pop .cont{min-height: 100px;}
10         #pop .btns{height: 50px;text-align: center;}
11     </style>
12     <script type="text/javascript">
13         function popWin(args) {
14             args.title = args.title || "标题";
15             args.cont = args.cont || "内容";
16 
17             var html = "<div class='title'>" + args.title + "<span id='close'>关闭</span></div>"
18                         + "<div class='cont'>" + args.cont + "</div>"
19                         + "<div class='btns'><input id='ok' type='button' value='确定' /><input id='cancel' type='button' value='取消' /></div>";
20 
21             var curPop = document.getElementById("pop");
22 
23             if (curPop === null) {
24                 var pop = document.createElement("div");
25                 pop.setAttribute("id", "pop");
26                 document.body.appendChild(pop);
27                 var tmp = document.getElementById("pop")
28                 tmp.innerHTML = html;
29             }
30 
31             show();
32 
33             document.getElementById("close").onclick = function () {
34                 hide();
35             }
36 
37             document.getElementById("ok").onclick = function () {
38                 hide();
39                 args.mok();
40             }
41 
42             document.getElementById("cancel").onclick = function () {
43                 hide();
44                 args.mcancel();
45             }
46 
47             function hide() {
48                 document.getElementById("pop").style.display = "none";
49             }
50 
51             function show() {
52                 document.getElementById("pop").style.display = "block";
53             }
54         }
55     </script>
56     <script type="text/javascript">
57         window.onload = function () {
58             document.getElementById("test").onclick = function () {
59 
60                 new popWin({ "cont": "这里是内容",
61                     "mok": function () {
62                         alert("aaaaa");
63                     },
64                     "mcancel": function () {
65                         alert("错误");
66                     }
67                 });
68                 console.log("ccccc");
69             }
70         }
71     </script>
72 </head>
73 <body>
74     <input id="test" type="button" value="弹出框" />
75 </body>
76 </html>

 

目录
相关文章
|
9月前
|
弹性计算 云计算 开发者
阿里云服务器秒杀活动怎么参与?2026年入口+攻略全解
阿里云2026服务器秒杀活动火热进行中!新用户实名认证后,每日10点/15点抢购高性价比云服务器。本文详解参与资格、抢购入口、秒杀技巧及99元/年等备选方案,助个人开发者与初创企业低成本、高效率上云。
739 3
|
弹性计算 人工智能 边缘计算
阿里云国际站2025年最新动态:全球云计算加速,中小企业出海利器
2025年,阿里云国际站凭借领先技术与本地化服务,助力企业高效出海。核心产品如弹性计算ECS Enterprise、云原生数据库PolarDB-X及边缘计算ENS Pro全面升级,覆盖全球28个区域,提供低延迟、高稳定性支持。同时推出“海外现货”模式,缩短外贸订单周期50%。通过技术+生态优势,助力中小企业实现全球化增长。
|
人工智能 程序员 开发者
如何使用Ascend的ATB加速库?
ATB加速库专为Transformer模型优化设计,基于华为Ascend AI处理器,提升训练和推理效率。本文档详细介绍了如何实现一个ATB算子,涵盖基础Operation、插件机制和Graph Frame三种方式,从环境准备、算子创建、资源管理到最终执行,提供了完整的代码示例和步骤指南,帮助开发者快速掌握ATB算子的开发流程。
|
安全 数据挖掘 定位技术
【外滩大会】摩斯发布MORSE DaaS 助力行业数智化发展
2023年9月外滩大会上,摩斯正式发布隐私计算数据智能服务MORSE DaaS。
【外滩大会】摩斯发布MORSE DaaS 助力行业数智化发展
针对职工工资的发放,给出各种标额最少的张数的付款方案,
/*针对职工工资的发放,给出各种标额最少的张数的付款方案, 票额包括:100元、50元、20元、10元、5元、2元、和1元。 思路:1、设工资数为total 2、100元的张数为total/100 50元的张数为total%100/50 20元的张数为to...
913 0
|
8天前
|
域名解析 人工智能 Linux
|
18天前
|
Linux Go 开发工具
手机上跑 DeepSeek 智能体:开源安卓客户端 DSH Go 安装与使用指南
DSH Go 是一款开源安卓客户端,将 DeepSeek Harness 智能体引擎装进手机:免 Root、免 Termux,一键安装即用;支持本机运行(内置 Ubuntu+Node.js)或远程接管电脑会话;具备插话打断、过程折叠、屏幕操控、端到端加密分享等特色功能,真正实现智能体“口袋化”。
16909 62
|
16天前
|
人工智能
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
进不去 Antigravity 或 Gemini,提示所在地区不可用?三步查清 Google 账号关联地区、官方更正表单理由选法与改区注意事项。
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
|
2天前
|
人工智能 安全 网络安全