runxinzhi.com
首页
百度搜索
使用半透明的DIV实现禁用页面功能
实现功能:弹出一个DIV层提示等待信息,这个时候禁用用户操作页面中的其他内容。
弹出DIV:
<
div
id
="divWaiting"
style
="display: none; z-index: 1100; left: 25%; right: 25%; position: absolute;
text-align: center; 50%; height: 50px; border-right: #009900 1px solid;
border-top: #009900 1px solid; border-left: #009900 1px solid; border-bottom: #009900 1px solid;
background-color: #f9fff6; left: expression((this.offsetParent.clientWidth/2)-(this.clientWidth/2)+this.offsetParent.scrollLeft);
top: expression((this.offsetParent.clientHeight/2)-(this.clientHeight/2)+this.offsetParent.scrollTop);"
>
<
br
>
The system is dealing with your request, please waiting
</
div
>
弄一个全屏的DIV来覆盖页面:
<
div
id
="divDisable"
style
="display: none;expression(document.body.offsetWidth);height:expression(document.body.offsetHeight); z-index: 1000; position: absolute;left: 0px; top: 0px;filter:alpha(opacity=50); background-color:White"
></
div
>
点击按钮的操作:
document.getElementById("divWaiting").style.display="";
document.getElementById("divDisable").style.display="";
其他处理:
function ChangeDiv()
{
document.getElementById("divDisable").style.height=document.body.offsetHeight+document.body.scrollTop;
}
window.onscroll=ChangeDiv;
分享到:
相关阅读:
mysql 锁
python——三道贪心算法例题
mysql 常见面试题
API 管理工具
如何实现一个简化版的 jQuery
js设计模式--发布订阅模式
React应该如何优雅的绑定事件?
js数据结构-链表
前端开发中的Error以及异常捕获
vue-router和webpack懒加载,页面性能优化篇
原文地址:https://www.cnblogs.com/qqflying/p/1070799.html
最新文章
toString()和toLocaleString()有什么区别
用css巧妙实现移动端横向滑动展示功能
手机端页面自适应解决方案—常见问题(转)
EasyUI-panel 内嵌页面上的js无法被执行
mysql 添加索引语句
Concurrent包下用过哪些类?
使用vue框架开发前端项目的步骤
cnpm install报错:Connect timeout for 5000ms 踩坑
windows环境搭建Vue开发环境
Nodejs安装及环境配置
热门文章
【SpringBoot系列】七、SpringBoot 中使用Redis缓存
Redis Desktop Manager的下载及安装
GitHub 上 window版本的Redis-x64-3.2.100.zip 下载没网速 以及安装
redis官方下载安装(Windows64位)
mysql 事务原理
mysql 8.0 新特性
算法 可视化网页
mysql 统计索引执行情况
mysql 缓存
mysql MVCC 实现原理
Copyright © 2020-2023
润新知