<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<title>Title</title>
</head>
<body>
<!-- <div style="position: absolute; width: 300px; height: 100px; margin-left: auto; margin-right: auto; left: 0; right: 0; border: 1px solid #e2e2e2; border-radius: 5px; font-family: YouYuan">-->
<!-- <div style="background-color: deepskyblue; height: 30px; line-height: 30px; border-radius: 5px 5px 0 0; padding-left: 10px">温馨提示</div>-->
<!-- <div style="padding: 10px 5px">这是一条消息</div>-->
<!-- <div id="more" style="display: none">这是更多消息</div>-->
<!-- <div style="position: absolute; bottom: 10%; right: 5%">-->
<!-- <button style="background-color:deepskyblue; border-radius: 5px; width: 50px; height: 30px; padding: 0; margin: 0; border: 1px transparent; outline: none">确定</button>-->
<!-- <button style="border-radius: 5px; width: 50px; height: 30px; padding: 0; margin: 0; border: 1px transparent; outline: none">取消</button>-->
<!-- </div>-->
<!-- </div>--> <button onclick="up()">confirm</button>
</body>
</html> <script> function up() {
var message = "这是展示消息";
myConfirm(message);
} function myConfirm(message) {
var html = ' <div id="popup" style="position: absolute; width: 400px; height: 145px; margin-left: auto; margin-right: auto; left: 0; right: 0; border: 1px solid #e2e2e2; border-radius: 5px; font-family: YouYuan">\n' +
' <div style="background-color: #00bfff; height: 30px; line-height: 30px; border-radius: 5px 5px 0 0; padding-left: 10px">温馨提示</div>\n' +
' <div style="padding: 10px 5px">' + message + '</div>\n' +
' <div id="more" style="display: none; padding: 0px 5px">这是更多消息</div>\n' +
' <div style="position: absolute; bottom: 10%; right: 5%">\n' +
' <button style="background-color:deepskyblue; border-radius: 5px; width: 50px; height: 30px; padding: 0; margin: 0; border: 1px transparent; outline: none" onclick="yes()">确定</button>\n' +
' <button style="border-radius: 5px; width: 50px; height: 30px; padding: 0; margin: 0; border: 1px transparent; outline: none" onclick="no()">取消</button>\n' +
' </div>\n' +
' </div>'; $("body").prepend(html);
} function yes() {
// $("#popup").css({display: "none"})
// if (document.getElementById("more").style.display === "none") {
// $("#more").css({display: "block"});
// $("#popup").css({height: "140px"});
// }else{
// $("#more").css({display: "none"});
// $("#popup").css({height: "100px"});
// }
window.
$("#popup").css({display: "none"});
alert("点击了“确定”");
}
function no() {
$("#popup").css({display: "none"});
alert("点击了“取消”");
}
</script>

重写简易的confirm函数的更多相关文章

  1. javascript confirm()函数的用法

    javascript confirm()函数的用法 confirm():确认消息对话框.用于允许用户做选择的动作.弹出的对话框中包含一确定按钮和一取消按钮. confirm(str) 参数说明: st ...

  2. 重写Oracle的wm_concat函数,自定义分隔符、排序

    oracle中,wm_concat函数是一个聚合函数,和mysql中的group_concat函数类似,不过group_concat函数比较强大,可以定义分隔符和排序,当然所谓强大是相对的,这里假使我 ...

  3. 重写QSqlTableModel的flags函数实现tableview中某些列不可编辑,某些可以编辑

    Qt中使用QsqlTableModel和QTableView来显示数据库的查询结果是非常方便的,但是为了使QTableView中某些了列不可用,就需要重写 Qt::ItemFlags flags(co ...

  4. [Winform]Cefsharp重写alert与confirm弹窗

    摘要 在使用winform内嵌cefsharp浏览本地页面的时候,如果出现alert弹窗,会在标题栏显示页面所在目录.所以想起来重写alert的样式,通过winform的MessageBox进行提示. ...

  5. 重写Alert和confirm方法去除地址显示

    //重写alert方法,去掉地址显示window.alert = function(name){var iframe = document.createElement("IFRAME&quo ...

  6. js confirm函数 删除提示

    <a href="del.php" onclick="return confirm('是否将此留言信息删除?')">删除留言</a>

  7. JS~重写alter与confirm,让它们变成fancybox风格

    插件与系统命令 对于很多JS弹框插件来说,都提供了alter,confirm等功能,如fancybox,Boxy等插件,今天来介绍一下如何将系统的alter和confirm替换成指定插件的alter和 ...

  8. 用scheme重写Python的三大函数map reduce 和filter

    重写过程中,发现这种做法能加深对递归的理解,而且reduce还体现了函数式编程是如何通过参数传递来实现命令式编程中的状态改变的. (define (imap f x . y) (if (null? y ...

  9. Cef 重写alert与confirm弹窗

    在使用form内嵌cef浏览本地页面的时候,如果出现alert弹窗,会在标题栏显示页面所在目录.所以想起来重写alert的样式,通过MessageBox进行提示,或者自己写一个弹窗. 以下代码基于 3 ...

随机推荐

  1. 【01python基础】

    1.python的环境搭建(Python3 下载) Python 官网:https://www.python.org/ Python文档下载地址:https://www.python.org/doc/ ...

  2. Chrome太占内存?试试这个

    " The Great Suspender" 是一个免费的开源 Google Chrome 扩展程序,适用于那些发现chrome占用过多系统资源或经常遭受chrome崩溃的人. 一 ...

  3. Java项目中经常遇到的一些异常情况

    一. 1. java.lang.nullpointerexception 这个异常大家肯定都经常遇到,异常的解释是"程序遇上了空指针",简单地说就是调用了未经初始化的对象或者是不存 ...

  4. Java环境变量,jdk和jre的区别,面向对象语言编程

    什么是java? java是一门面向对象的编程语言,包括java SE, java ME, Java EE . 广泛使用的是作为后端语言的Java EE开发, 面向对象和面向过程? java,C++ ...

  5. MySQL数据库——连接查询

    1.基本含义 连接就是指两个或2个以上的表(数据源)“连接起来成为一个数据源”. 实际上,两个表的完全的连接是这样的一个过程: 左边的表的每一行,跟右边的表的每一行,两两互相“横向对接”后所得到的所有 ...

  6. Python中json.dump与repr的区别

    Json是一种轻量级的数据交换格式,Python3 中可以使用 json 模块来对 JSON 数据进行编解码,它包含了两个函数: 引入json包: import json json.dumps(): ...

  7. K8s集群verification error" while trying to verify candidate authority certificate "kubernetes"

    问题内容 because of "crypto/rsa: verification error" while trying to verify candidate authorit ...

  8. RNN以及LSTM简介

    转载地址 https://blog.csdn.net/zhaojc1995/article/details/80572098 本文部分参考和摘录了以下文章,在此由衷感谢以下作者的分享! https:/ ...

  9. 【luogu4137】 Rmq Problem / mex - 莫队

    题目描述 有一个长度为n的数组{a1,a2,…,an}.m次询问,每次询问一个区间内最小没有出现过的自然数. 思路 莫队水过去了 233 #include <bits/stdc++.h> ...

  10. 第三章 kubernetes核心原理

    kubernetes API Server 提供了Kubernetes各类资源对象(如pod,re,service等)的增删改查及watch等Http Rest接口,成为集群内各个功能模块之间数据交互 ...