js
This commit is contained in:
parent
74e6f8295e
commit
6231dbaeda
BIN
javascript/17style操作.assets/2020060423401084.png
Normal file
BIN
javascript/17style操作.assets/2020060423401084.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 332 KiB |
@ -14,7 +14,30 @@ el.style.css = value
|
|||||||
- removeProperty 删除css属性
|
- removeProperty 删除css属性
|
||||||
- setProperty 设置css属性
|
- setProperty 设置css属性
|
||||||
|
|
||||||
## 元素尺寸
|
## 偏移尺寸
|
||||||
|
|
||||||
![jacascript 偏移量offset、客户区client - 快乐锁- 博客园](17style操作.assets/1067628-20170420000550759-576494200.jpg)
|
![jacascript 偏移量offset、客户区client - 快乐锁- 博客园](17style操作.assets/1067628-20170420000550759-576494200.jpg)
|
||||||
|
|
||||||
|
这些都是相对于父元素的
|
||||||
|
|
||||||
|
## 客户端尺寸
|
||||||
|
|
||||||
|
![JavaScript浏览器视口相关属性(图解) | 码农家园](17style操作.assets/2020060423401084.png)
|
||||||
|
|
||||||
|
元素内部空间
|
||||||
|
|
||||||
|
## 滚动尺寸
|
||||||
|
|
||||||
|
![js第225天解释下offsetWidth、clientWidth、scrollWidth这三者的区别是什么? · Issue #1572 · haizlin/fe-interview · GitHub](17style操作.assets/69684321-3e819b00-10f3-11ea-8b1b-6c550fb8a78c.png)
|
||||||
|
|
||||||
|
## 确定元素尺寸
|
||||||
|
|
||||||
|
getBoundingClientRect()
|
||||||
|
|
||||||
|
- letf
|
||||||
|
- right
|
||||||
|
- top
|
||||||
|
- bottom
|
||||||
|
- height
|
||||||
|
- width
|
||||||
|
|
||||||
|
21
javascript/18事件.md
Normal file
21
javascript/18事件.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# 事件
|
||||||
|
|
||||||
|
## 事件处理
|
||||||
|
|
||||||
|
### html
|
||||||
|
|
||||||
|
- onclick
|
||||||
|
|
||||||
|
> event
|
||||||
|
|
||||||
|
### js
|
||||||
|
|
||||||
|
- addEventListener("")
|
||||||
|
- revomeEventListenet()
|
||||||
|
|
||||||
|
> 注意匿名函数
|
||||||
|
|
||||||
|
## 事件类型
|
||||||
|
|
||||||
|
.....
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
9
javascript/19事件流.md
Normal file
9
javascript/19事件流.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# 事件冒泡与捕获
|
||||||
|
|
||||||
|
![理解DOM事件与事件委托- 知乎](19事件流.assets/v2-2bd515bb574e14cb14f19eff66dd5673_720w.jpg)
|
||||||
|
|
||||||
|
事件冒泡会从内往外厨房事件
|
||||||
|
|
||||||
|
事件捕获会从外向内触发(传播)
|
||||||
|
|
||||||
|
使用监听事件 第三个参数 ture 就是事件捕获
|
6
javascript/20事件委托.md
Normal file
6
javascript/20事件委托.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# 事件委托
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
> 依赖于事件冒泡来搞 只需要在最外面监听 id
|
||||||
|
|
17
javascript/21 http请求.md
Normal file
17
javascript/21 http请求.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# xhr
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest()
|
||||||
|
|
||||||
|
xhr.open(method,"url,是否同步)
|
||||||
|
|
||||||
|
xhr.open(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
xhr.open("get","url",false)
|
||||||
|
xhr.send(null)
|
||||||
|
// xhr.status 状态码
|
||||||
|
// xhr.responseText 后台返回内容
|
||||||
|
|
||||||
|
```
|
9
javascript/22.定时器.md
Normal file
9
javascript/22.定时器.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# 定时器
|
||||||
|
|
||||||
|
setTimeout
|
||||||
|
|
||||||
|
setTnterval
|
||||||
|
|
||||||
|
crearTimeout()
|
||||||
|
|
||||||
|
crearInterval()
|
Loading…
Reference in New Issue
Block a user