当前位置:网站首页>DOM day_ 04 (7.12) BOM, open new page (delayed opening), address bar operation, browser information reading, historical operation
DOM day_ 04 (7.12) BOM, open new page (delayed opening), address bar operation, browser information reading, historical operation
2022-07-27 00:41:00 【Add 1 bed of bedding】
review
1. Bubbling mechanism
(1) When an event occurs on a child element , Can pass its parent element
(2) Event delegation :
- Help child elements complete events through parent elements
- Suitable for the scene : Dynamically added child elements
(3) Event parameters
- target: This property stores the
Party element - stopPropagation: Stop bubbling
2. Block default events : In the event parameter preventDefault. Mainly used for hyperlinks
3. Event parameters of mouse click , Several sets of coordinate values
- screenX, screenY: Relative to the upper left corner of the screen
- x, y: Relative to the upper left corner of the browser content area
- offsetX, offsetY : Compared with the upper left corner of the event element where the click event occurs
4. Page scrolling Events : onscroll
- Read offset :
document.documentElement.scrollTop || document.body.scrollTop
5. Old version operation of property
- getAttribute: Get the value of a property
- setAttribute: Set the value of a property
6.JS Way to create DOM Elements
(1) The ultimate performance : Give up using HTML Code to write , Direct use JS Code
document.createElement( Tag name )
(2) Document fragment : Improve Traverse creation DOM Performance consumption of element
Generate the traversal DOM The elements of are first placed in the fragment , Finally, put the fragment on the page
7.DOM Encapsulation ( Elective )
- Use function encapsulation skills , Put the original DOM simplified .
document.querySelectorAll->$- More prototype methods are provided , Automatic traversal
- This idea is
jQueryThe idea of encapsulation
This idea is
jQueryThe idea of encapsulation
DOM The routine is just two points :
First find the element to operate
Multiple elements , You need to traverse
Properties of the operation element
One 、BOM
Browser Object Model: Browser object model
Used to operate various properties on the browser

Two 、 Open a new page

3、 ... and 、 Address bar operation


Four 、 Browser information reading

5、 ... and 、 Historical operation

边栏推荐
- 9_逻辑回归(Logistic Regression)
- [3. VIM operation]
- Oracle data guard service, process and protection mode
- 7_主成分分析法(Principal Component Analysis)
- [4.4 detailed explanation of fast power and inverse element of fast power]
- c语言 比大小的多种描述,不要只拘泥于一种写法
- 12_决策树(Decision tree)
- Deployment of yolov5 on Jetson nano deepstream
- [4.9 detailed explanation of inclusion exclusion principle]
- Drawing warehouse Tsai
猜你喜欢

动态联编和静态联编、以及多态
![[3. Basic search and first knowledge of graph theory]](/img/a2/dced231f746cc049d310e364a81856.png)
[3. Basic search and first knowledge of graph theory]

MySql

MySQL associative table queries (reducing the number of queries)

2022-07-17:1, 2, 3... N-1, N, n+1, n+2... In this sequence, only one number has repetition (n). This sequence is unordered. Find the repeated number n. This sequence is ordered. Find the repeated numb

On the expression of thymeleaf

Helicopter control system based on Simulink

Drawing warehouse-2 (function image)

Find method of web page parsing by crawler

Three tier architecture simulation
随机推荐
用New,delete和用malloc,free申请,释放堆区空间
Input a string of letters and output the vowels inside. I hope you guys can give guidance
Downloading and processing of sentinel-2
Matlab based medical imaging technology filtering backprojection simulation, including direct backprojection, S-L filtering, R-L filtering, LeWitt filtering
[4.10 detailed explanation of game theory]
2020-12-20 九九乘法表
[4.7 Gauss elimination details]
[3. Basic search and first knowledge of graph theory]
MySql
Eight queens n Queens
【2. Tmux 操作】
"Could not load host key" error when xshell connects to the server
Signal and system learning zero input response
UNET notes
并行MPI程序传递发送消息
Web middleware log analysis script 2.0 (shell script)
【3. 基础搜索与图论初识】
【4.6 中国剩余定理详解】
Mysql互不关联的联表查询(减少了查询的次数)
[Qt]容器类、迭代器、foreach关键字