当前位置:网站首页>25. BOM events
25. BOM events
2022-06-10 04:34:00 【Suyuoa】
1 Window load event onload
Similar to the document loading event described earlier , Before we looked for the elements in the window , Must be written below the creation element


Now I want to script Put it on top , Then I will use the window loading event onload

When the document content (html,css,JS) The window loading event will be triggered after the complete loading ( The document loading event puts html After loading, it will trigger , That is to say, the execution sequence of document loading events is higher than that of window loading events )
Let's put script Move it up

Discovery can take effect

window.onload It is a traditional registration method , If you want to register multiple , Then you have to use window.addEventListener('load',function(){})
2 Window resizing Events onresize

This event will be triggered when the window is resized

When we resize the window, we specify multiple functions
![]()
- Press... Directly after opening the page F12 This event will also be triggered , Because a little more will change the size of the browser
It is usually done according to the screen size , For example, drag the screen size to a certain size , I just let the background change color
- We go through window.innerWidth To get the current browser width ,window.innerHeight You can get the current browser height

It is white after opening

Drag it casually to turn it into cyan , Because the width is less than 900

When dragging to greater than 900 Turns red when

边栏推荐
- [understanding of opportunity -22]: Guiguzi - the art of closing Tibet. Collect your talents in time to protect yourself in the workplace, business and business activities
- Temporary global variables and iritemp database
- Quic must see
- 图解固件、驱动、软件的区别
- CVPR 2022 | indirect lighting modeling in inverse rendering
- MindSpore【数据集功能】无法查看数据集
- S系列·修改文件的时间属性
- 如何用全国天气预报API接口进行快速开发
- [laser principle and application-1]: what is a laser and its common applications
- GUI programming student achievement management system
猜你喜欢

MeterSphere | 超好用的开源测试平台
![[graduation project 2] intelligent range hood system based on stm32](/img/b0/2ab9f22c939198f3cd5fcf11d87998.png)
[graduation project 2] intelligent range hood system based on stm32

Basic methods of stack and related problems

昇腾910上分布式加载模型与增量训练

分布式数据对象:超级终端的'全局变量'

图解固件、驱动、软件的区别

Figure out the difference between firmware, driver and software

Puzzling color deviation of unity illumination black

CVPR 2022 | indirect lighting modeling in inverse rendering

Good news 𞓜 wangchain technology signed the Miluo cultural, tourism and sports industry project to create a digital village on the "chain"
随机推荐
OpenJudge NOI 1.13 13:人民币支付
[learn FPGA programming from scratch -16]: quick start chapter - operation steps 2-4- basic syntax of Verilog HDL language description language (both software programmers and hardware engineers can un
S系列·修改文件的时间属性
信息学奥赛一本通 1287:最低通行费 | OpenJudge NOI 2.6 7614:最低通行费
Network principle TCP
Detailed explanation of tcp/ip protocol mechanism
Pampy | powerful pattern matching tool
Fastapi-15-file upload-3
QT cannot connect to local MySQL
Getting started with JDBC example
Source code encryption software type analysis
Detailed explanation of thread pool creation method
Meanings of letters in PMP project management calculation PV, EV, AC, SV, CV, SPI, CPI
什么时候用@ComponentScan?与@MapperScan有什么区别?
大事件回顾 | Eolink 5月重要动态速览!
FCOS模型在使用mindspore实现时,梯度集中在0的情况
Gevent | 异步就用它!
When to use @componentscan? What is the difference with @mapperscan?
Super easy to use chrome plug-in!
CSDN audio and video technology developers' online survey