自定义提示信息框

html 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .tk_suss {
            border: 1px solid #c3e6cb;
            display: none;
        }

        .tk_sb {
            border: 1px solid #fc5531;
            display: none;
        }

        .tk_error {
            padding: 0 20px;
            height: 40px;
            color: #2b2b2c;
            font-size: 18px;
            line-height: 40px;
            text-align: center;
            border-radius: 5px;
            position: fixed;
            top: 40%;
            left: 50%;
            background-color: rgba(0, 0, 0, 0.5);
            color: #fff;
        }
    </style>
</head>

<body>
    <div class="tk tk_suss">
        提交成功
    </div>
    <div class="tk tk_sb">
        提交失败
    </div>
    <div class="tk_error">Code Error</div>
</body>


<script>
    let failNode1 = $(`<div class="tk_error" id="tk_error">Code Error</div>`)
    $('body').append(failNode1)
    setTimeout(function () {
        $('#tk_error').remove();
    }, 2000)


</script>

</html>
相关推荐
雪芽蓝域zzs18 分钟前
从零搭建【pnpm+Vue3+TS+Setup+VueRouter4+Pinia+Axios+ElementPlus (unplugin 按需)】仿若依后台
前端·vue.js
燕落南枝25 分钟前
HTML 列表标签详解:有序列表、无序列表与描述列表
前端·html
派小心.1 小时前
DAU和MAU怎么计算?先确定活跃事件、用户键和统计窗口
大数据·服务器·前端·人工智能·数据分析
代码猎人1 小时前
前端怎么配合后端完成bug修复
前端
叫我铁汁儿吧1 小时前
JS作用域
前端·面试
定栓1 小时前
Webpack迁到Vite第七节(四):全家桶移除 — 保留项、脚本与数据收尾
前端·webpack·node.js
VimorphTech1 小时前
React 任务轮询,为什么不能只写一个 setInterval?
javascript·typescript
代码猎人1 小时前
前端怎么优化首屏加载速度
前端
代码猎人1 小时前
前端怎么保障项目稳定上线与运行
前端
数据掘金1 小时前
小程序埋点方案的埋点文档怎么自动生成?
前端