12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <!--<!DOCTYPE html>-->
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../../lib/jquery/jquery-3.2.1.min.js"></script>
- <link rel="stylesheet" href="../../lib/bootstrap/css/bootstrap.min.css">
- <script src="../../lib/bootstrap/bootstrap.min.js"></script>
- <script src="../../public/web/PerfectLoad.js"></script>
- </head>
- <body>
- <button id = "btnA">按钮A</button>
- <button id = "btnB">按钮B</button>
- <button id = "btnC">按钮C</button>
- <button id = "btnD">按钮D</button>
- <script>
- !function loadHintBox(){
- $("body").append('<div id = "hintBox_container"></div>');
- $("#hintBox_container").load("../../public/scHintBox.html");
- }();
- $(document).ready(function(){
- function cbYes() {alert('你点击了yes按键');};
- function cbNo() {alert('你点击了no按键');}
- $("#btnA").click(function(){
- let s = hintBox.font('5');
- hintBox.infoBox('系统提示', `该行已被第 ${s} 行引用,不允许删除!`, 1);
- });
- $("#btnB").click(function(){
- hintBox.infoBox('操作确认', '确定要删除当前节点吗?', 2, cbYes);
- // 或: hintBox.infoBox('操作确认', '确定要删除当前节点吗?', 2, cbYes, cbNo);
- });
- $("#btnC").click(function(){
- hintBox.infoBox('多分支选择', '三个按钮是否继续?', 3, cbYes, cbNo);
- // 或: hintBox.infoBox('多分支选择', '三个按钮是否继续?', 3, cbYes, undefined, ['你','我','他']);
- });
- $("#btnD").click(function(){
- hintBox.valueBox('请输入新名称:', '111', function () {
- let newName = hintBox.value;
- if (newName == '') {
- hintBox.error('名称不能为空!');
- return false;
- };
- if (newName == '111') {
- hintBox.error(`“${newName}” 已存在,请重新输入!`);
- return false;
- };
- });
- });
- });
- </script>
- </body>
- </html>
|