通过jquery实现覆盖全屏的警告框
来源:互联网 发布:安卓 知乎 输入法 编辑:程序博客网 时间:2024/06/06 00:13
效果:点击“提交”弹出警告框,然后单击警告框任意位置,警告框消失。
代码和效果如下
<!DOCTYPE html><html><head><meta charset="utf-8"><title>登录</title><link rel="stylesheet" href="../CSS/bootstrap.min.css" /><style>.form-control {margin-top: 15px;}.btn-default {margin-top: 15px;}.alert {width: 300px;margin: 20% auto;opacity: 5;z-index: 4;}.mask{position: absolute;left: 0px;top: 0px;height: 100%;width: 100%;z-index: 3;background: rgba(63,63,63,0.6);display: none;}</style></head><body><form name="loginForm"><div class="container"><div class="input-group col-md-6 col-md-offset-3"><input type="text" id="input_user_id" class="form-control" placeholder="Username" /><input type="text" id="input_passwd" class="form-control" placeholder="Password" /><button type="button" id="btn_submit" class="btn btn-default">提交</button></div></div></form></body><div class="mask"></div><script type="text/javascript" src="../js/jquery-1.11.0.min.js"></script><script type="text/javascript" src="../js/bootstrap.min.js"></script><script type="text/javascript">$("#input_user_id").keydown(function(e) {if (e.which == 13) {$("#input_passwd").focus();}});$("#btn_submit").click(function(){$(".mask").append("<div class='alert alert-warning'>\<a href='#' class='close' data-dismiss='alert'>\</a>\<strong>警告!</strong>输入账号密码有误!\</div>");$(".mask").toggle();});$(".mask").click(function(){$(".mask").toggle();$("div.alert").remove();})/*$.ajax({url : "/demo/user/login",type : "POST",data : {"username" : "userpw" : },dataType : "json",success : function(data,textStatus){if(data.code === "501"){} else if(data.code === "502"){} else if(data.code === "503"){} else if(data.code === "200"){ // success}}});*/</script></html>
$(".mask").click(function(){$(".mask").toggle();<strong>$("div.alert").remove();</strong>})
0 0
- 通过jquery实现覆盖全屏的警告框
- jQuery右侧弹出全屏覆盖菜单
- jQuery右侧弹出全屏覆盖菜单
- iphone通过UIActionSheetDelegate实现警告
- iphone通过UIActionSheetDelegate实现警告
- iphone通过UIActionSheetDelegate实现警告
- Swing实现全屏(覆盖任务栏和不覆盖任务栏)
- Swing实现全屏(覆盖任务栏和不覆盖任务栏)
- 用JQuery实现全屏banner
- JS或jQuery实现全屏
- jQuery实现全屏幻灯片的滚动页面特效
- Android内容覆盖透明状态栏下实现全屏模式下带状态栏的效果
- iOS_覆盖uitabbarcontroller全屏的view
- 点击弹出覆盖全屏的灰色
- 如何通过jQuery实现select下拉框的联动效果
- iOS 自定义警告框的实现
- jquery实现当前页面按钮点击全屏,点击退出全屏
- 实现全屏的方法
- 黑马程序员—DOS的常用命令及JDK安装
- 斐波那契数列
- JBoss5.1GA启动异常
- js判断指定函数、变量是否存在的方法
- SUSE环境编译cannot find -lcrypto
- 通过jquery实现覆盖全屏的警告框
- iOS面试题
- Problem B: [NOIP2013]花匠 D2 T2
- 设计模式C++实现(8)——代理模式
- jQuery UI炫酷雨滴落在水面上的波纹涟漪特效
- cmd连接mysql的方法详解
- java万年历
- TCP/IP协议簇
- JMS消息服务