js+html5实现半透明遮罩层弹框效果
作者:ouqi_qiou 时间:2024-05-08 09:33:09
点击按钮,出现半透明遮罩层弹框,说说自己之前发过的愁吧
1、遮罩层半透明了 弹框也跟着半透明了 就像这样 绝望吧
是哪里错了呢?你的css是这样写的吧:
应该这样:
需要注意的是这几个参数的意思:RGB Red Green Bule 3色!及212, 0, 0 三色的值混合 .最后一个参数 0.5 是指的透明度 1表示不透明
2、半遮罩层里面的内容可以上下滑动 感觉挺好玩的 /笑哭
修改就是把半遮罩层的position设置为fixed 里面的内容就不会变啦
接下来就是代码show
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.tip{
text-align: center;
position: absolute;
height: 100%;
width: 100%;
background-color: rgba(90, 90, 90, 0.5);
z-index: 99999;
}
.collectSucc{
position: fixed;
height: auto;
width: 70%;
background-color: #ffffff;
margin-left: 15%;
margin-top: 50%;
}
.collectSucc_top{
color: #666666;
font-size: 12px;
}
.collectSucc_top img{
width: 60px;
margin-top: 20px;
}
.collectSucc_buttom{
margin-top: 20px;
height: 40px;
line-height: 40px;
background-color: #2d99f5;
color: #FFFFFF;
font-size: 13px;
}
</script>
</head>
<body>
<div class="tip">
<!--收款成功-->
<div class="collectSucc">
<div class="collectSucc_top">
<img src="../../img/tip.png" />
<div>抢单失败,试试其他行程吧!</div>
</div>
<div class="collectSucc_buttom">
我知道了
</div>
</div>
</div>
你好 我叫欧琪 啊哈哈
</body>
</html>
样式是这样的:
标签:js,html5,遮罩层,弹框
0
投稿
猜你喜欢
如何真正的了解python装饰器
2023-03-16 09:08:23
Python动态加载模块的3种方法
2023-12-22 21:33:29
Pycharm没有报错提示(误触ignore)的完美解决方案
2023-01-24 13:39:34
Node.js中的events事件模块知识点总结
2024-05-08 10:11:37
浅析Python中MySQLdb的事务处理功能
2024-01-14 01:23:10
Go语言kylin任务自动化实例详解
2024-05-08 10:24:04
asp如何判断偶数和奇数?
2010-01-12 20:16:00
mysql数据库忘记管理员密码的解决方法
2024-01-24 10:56:55
Python实现曲线点抽稀算法的示例
2023-02-11 02:57:58
python游戏实战项目之童年经典超级玛丽
2022-10-01 08:16:34
理解MySQL查询优化处理过程
2024-01-21 18:30:46
Python实现FLV视频拼接功能
2021-09-19 02:41:48
SQL Server自定义异常raiserror使用示例
2024-01-22 10:41:08
实现一个获取元素样式的函数getStyle
2009-02-10 10:37:00
HTML5 的五个激动人心的特性
2009-01-02 17:36:00
perl脚本实现限制ssh最大登录次数(支持白名单)
2022-04-09 02:56:56
Python连接es之es更新操作示例详解
2022-11-21 06:11:48
pycharm修改file type方式
2022-10-08 15:25:36
linux下perl操作mysql数据库(需要安装DBI)
2024-01-15 09:32:50
python实现自动打卡的示例代码
2022-11-29 15:01:57