前端笔记整理完成

This commit is contained in:
estomm
2022-04-18 23:03:54 +08:00
parent bb9110d289
commit 3d6284517e
50 changed files with 5685 additions and 15 deletions

View File

@@ -30,13 +30,21 @@
* unload
## 2 事件处理
### 事件处理方法
### 直接绑定事件处理方法
回调函数作为参数进行传递。
```
("p").click(function(){$(this).hide()});
$("p").click(function(){$(this).hide()});
```
### $(document).ready()
在加载完成文档后需要执行的函数。
### 通过bind绑定事件处理方法
可以直接在jQuery对事件进行绑定。而不用在html代码中书写js代码了。
* bind绑定
```
$(selector).bind(eventtype,eventdata,handler(eventobject))
```