当前位置:网站首页>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;
});边栏推荐
- 获取文本选择的方向
- 牛客刷题——Mysql系列
- (C语言)浅识#define
- idea中检索此方法中有哪些参数以便我们使用——1.类图。2.双击shift
- Ros2 method of obtaining current system time
- contenteditable 元素的placeholder
- Error in render: “TypeError: data.slice is not a function“
- Flutter Performance Optimization Practice - UI chapter
- 2022-7-26 第七组 抽象和接口
- [download materials of harmoniyos topics] HDD Hangzhou station · offline salon focuses on application innovation to show the ecological charm of Hongmeng
猜你喜欢

立即报名:7 月 29 日推荐系统峰会 2022

How to enter the specified user method body when debugging in idea?
![[hcie security] dual computer hot standby - primary and standby backup](/img/3b/392aabd9915a3f0997cf7a72240d63.png)
[hcie security] dual computer hot standby - primary and standby backup

Devsecops, speed and security

2022开放原子全球开源峰会议程速递 | 7 月 27 日分论坛议程一览

功能尝鲜 | 解密 Doris 复杂数据类型 ARRAY
![[must read new] Keya valuation analysis of University of technology, heating energy-saving products](/img/e8/c3ac4e5f11db58031cb9249a4ba0f4.jpg)
[must read new] Keya valuation analysis of University of technology, heating energy-saving products

【HCIE安全】双机热备-主备备份

Redis hash和string的区别

What are the characteristics of low code tools? The two development tracks of low code that can be seen by discerning people!
随机推荐
Valley segment coverage - (summary of interval sequencing problem)
Niuke multi school -journey- (map building distra+ card often optimization)
Mobile phone \ landline call forwarding setting method
Cfdiv1+2-pathwalks- (tree array + linear DP)
[must read new] Keya valuation analysis of University of technology, heating energy-saving products
一些意想不到的bug记录
[virtual machine data recovery] data recovery of XenServer virtual machine unavailable due to unexpected power failure
和月薪3W的字节程序员聊过后,才知道自己一直在打杂...
我们被一个 kong 的性能 bug 折腾了一个通宵
Multivariable time series prediction using LSTM -- problem summary
制作一个可调整大小的元素
There are six ways to help you deal with the simpledateformat class, which is not a thread safety problem
Relevant contents about wireless communication
HTTP cache browser cache that rabbits can understand
2022-7-26 the seventh group of abstractions and interfaces
Is it reliable, reliable and safe to open an account with a low commission for funds in Galaxy Securities
6种方法帮你搞定SimpleDateFormat类不是线程安全的问题
Detailed illustration of B-tree and its implementation in C language
Daily practice ----- there is a group of students' grades. Arrange them in descending order. To add a student's grade, insert it into the grade sequence and keep the descending order
Web3.0 时代,基于P2PDB实现一款Dapp的技术理论