当前位置:网站首页>Show load indicator when loading iframe
Show load indicator when loading iframe
2022-07-26 21:27:00 【Ziwei front end】
<iframe id="frame"></iframe>Mark
<div class="container">
<!-- The loading indicator -->
<div class="loading" id="loading">Loading</div>
<!-- The iframe -->
<iframe id="frame" style="opacity: 0"></iframe>
</div>.container {
/* To position the loading */
position: relative;
}
.loading {
/* Absolute position */
left: 0;
position: absolute;
top: 0;
/* Take full size */
height: 100%;
width: 100%;
/* Center */
align-items: center;
display: flex;
justify-content: center;
}Handling events
// Query the elements
const iframeEle = document.getElementById('iframe');
const loadingEle = document.getElementById('loading');
iframeEle.addEventListener('load', function () {
// Hide the loading indicator
loadingEle.style.display = 'none';
// Bring the iframe back
iframeEle.style.opacity = 1;
});边栏推荐
- Multivariable time series prediction using LSTM -- problem summary
- Flutter Performance Optimization Practice - UI chapter
- Ros2 method of obtaining current system time
- Soft test --- database (1) database foundation
- 银河证券场内基金低佣金开户靠谱吗,可靠安全吗
- 调整表格列的大小
- CFdiv1+2-Pathwalks-(树状数组+线性dp)
- idea中debug时如何进入指定的用户方法体中?
- Valley segment coverage - (summary of interval sequencing problem)
- CONDA reports an error: json.decoder.jsondecodeerror:
猜你喜欢

如何在一个项目中使用多种不同的语言?

QT Foundation Day 1 (1) QT, GUI (graphical user interface) development

MySQL的JDBC操作及入门案例

Flutter Performance Optimization Practice - UI chapter

DeepFake捏脸真假难辨,汤姆·克鲁斯比本人还像本人!

TypeScript中的类型断言

Mobile phone \ landline call forwarding setting method

Alkbh1

除了「加机器」,其实你的微服务还能这样优化

How to use multiple languages in a project?
随机推荐
Object.getOwnPropertyNames() VS Object.keys()
1-《PyTorch深度学习实践》-线性模型
idea中设置核心配置文件的模板
Multivariable time series prediction using LSTM -- problem summary
Browser browser cache
【虚拟机数据恢复】意外断电导致XenServer虚拟机不可用的数据恢复
conda报错:json.decoder.JSONDecodeError:
IT系统为什么需要可观测性?
有关无线通信的相关内容
Practice of microservice in solving Library Download business problems
记一次invalid bound statement xxxxxx 问题解决思路
Introduction to the billing function of wechat payment
Modify excel default code
获取文本选择的方向
【HCIA安全】双向NAT
Summary of 4 years of software testing experience and interviews with more than 20 companies after job hopping
Arm TZ hardware support
About: get the domain controller of the current client login
苹果官网罕见打折,iPhone13全系优惠600元;国际象棋机器人弄伤对弈儿童手指;国内Go语言爱好者发起新编程语言|极客头条
滤波及失真