From 75a29d92ee90cf398d5c071d4ad488c617d33b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E6=9F=8F=E6=88=90?= <2771940338@qq.com> Date: Fri, 2 Dec 2022 12:15:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E5=8D=81=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E3=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232/2022-11-28.html" | 140 ++++++++++++++++++ .../\344\275\234\344\270\232/2022-12-1.html" | 27 ++++ ...15\344\275\234\345\205\203\347\264\240.md" | 61 ++++++++ ...13\344\273\266\345\257\271\350\261\241.md" | 31 ++++ .../2022-12-01\346\226\271\346\263\225.md" | 85 +++++++++++ 5 files changed, 344 insertions(+) create mode 100644 "08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-11-28.html" create mode 100644 "08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-12-1.html" create mode 100644 "08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-28\346\223\215\344\275\234\345\205\203\347\264\240.md" create mode 100644 "08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-30\344\272\213\344\273\266\345\257\271\350\261\241.md" create mode 100644 "08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-12-01\346\226\271\346\263\225.md" diff --git "a/08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-11-28.html" "b/08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-11-28.html" new file mode 100644 index 0000000..8c0c4a0 --- /dev/null +++ "b/08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-11-28.html" @@ -0,0 +1,140 @@ + + + + + + + Document + +
+ 0 + 1 + 2 + 3 + +
+
+ + + +
+
+ +
+
+ + + +
+ 用户名:
+ 密 码:
+ 确认密码:
+
+
+ + + + + + + + + + + +
留言 0
+ +
+ + + + + + + + \ No newline at end of file diff --git "a/08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-12-1.html" "b/08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-12-1.html" new file mode 100644 index 0000000..f21f740 --- /dev/null +++ "b/08\345\273\226\346\237\217\346\210\220/\344\275\234\344\270\232/2022-12-1.html" @@ -0,0 +1,27 @@ + + + + + + + Document + + + + + + + + + + \ No newline at end of file diff --git "a/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-28\346\223\215\344\275\234\345\205\203\347\264\240.md" "b/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-28\346\223\215\344\275\234\345\205\203\347\264\240.md" new file mode 100644 index 0000000..8e24338 --- /dev/null +++ "b/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-28\346\223\215\344\275\234\345\205\203\347\264\240.md" @@ -0,0 +1,61 @@ +# jQuery Dom 操作 + +## **1** **操作元素的属性** + +| 方法 | 说明 | 举例 | +| -------------- | ------------------------------------------------------------ | --------------------------------- | +| attr(属性名称) | 获取指定的属性值,操作checkbox时
选中返回checked,没有选中返回undefined。 | attr('checked')
attr('name') | +| prop(属性名称) | 获取具有true和false两个属性的属性值 | prop('checked') | + +返回值是bool的属性: checked ,selected, disabled + + + +### 1.2 设置属性 + +### attr('属性名','属性值') + + + + + +### 1.3 移除属性 + +### removeAttr('属性名') + + + +### 添加样式名称 + +### addClass('样式名') + + + +### 移除样式名称 + +### removeClass(class) + + + +### 切换样式名称 + +## toggleClass() + + + +#### 操作元素内容 + +| 方法 | 说明 | +| ----------------- | ---------------------------------- | +| html() | 获取元素的html内容 | +| html('html内容') | 设定元素的内容 | +| text() | 获取元素的内容,不识别html标签 | +| text('text 内容') | 设置元素的文本内容,不识别html标签 | +| val() | 获取元素的值(表单元素) | +| val('值') | 设定元素的值 | + +#### 遍历元素 + +each() + +$(selector).each(function(index,element)):遍历元素 \ No newline at end of file diff --git "a/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-30\344\272\213\344\273\266\345\257\271\350\261\241.md" "b/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-30\344\272\213\344\273\266\345\257\271\350\261\241.md" new file mode 100644 index 0000000..4065e7c --- /dev/null +++ "b/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-11-30\344\272\213\344\273\266\345\257\271\350\261\241.md" @@ -0,0 +1,31 @@ +# jQuery事件对象 + + + +### 绑定事件的三种类型 + + + +## 直接绑定(最简单也是最常用) + +#### $(selector).event(function(){}) + + + +#### bind绑定 + +### $(selector).off(event,selector,function(eventObj),map) + +![img](https://upload-images.jianshu.io/upload_images/14415740-c70031137be2807f.png?imageMogr2/auto-orient/strip|imageView2/2/format/webp) + + + +### on()绑定 + +### $(selector).on(event,childSelector,data,function) + + + +### 合成事件hover $().hover(fn1, fn2) + +#### 解绑事件 jQuery的off()方法 $(selector).off(type) \ No newline at end of file diff --git "a/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-12-01\346\226\271\346\263\225.md" "b/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-12-01\346\226\271\346\263\225.md" new file mode 100644 index 0000000..d9cc460 --- /dev/null +++ "b/08\345\273\226\346\237\217\346\210\220/\347\254\224\350\256\260/2022-12-01\346\226\271\346\263\225.md" @@ -0,0 +1,85 @@ +## 遍历元素each() + +$('li').each(function(index, element){ …… }) + +如果需要退出each循环,可以在回调函数中返回false,也就是return false即可 + +# 插入元素 + + prepend() 和 prependTo() + append() 和 appendTo() + before() 和insertBefore() + after() 和 insertAfter() + +# 删除元素 + + remove():全部删除 + + detach():删除,保留事件 + + empty():清空元素,保留标签 + +# 复制元素 + +$().clone(bool): true:深拷贝将事件和元素一起拷贝 false:只拷贝元素 + +# 包裹元素 + + wrap() + + wrapAll() + + wrapInner() + + +类名过滤: hasClass() +$().hasClass(“类名”) + +## 下标过滤: eq() + +$().eq(n) + +## 判断过滤: is() + +$().is(selector) +参数selector是一个选择器。is()方法用于判断当前选择的元素集合中,是否存在符合条件的元素。 + +如果存在,则返回true;如果不存在,则返回false。 + +#### //判断元素是否可见 + +$().is(":visible") + +#### //判断元素是否处于动画中 + +$().is(":animated") + +#### //判断单选框或复选框是否被选中 + +$().is(":checked") + +#### //判断当前元素是否第一个子元素 + +$(this).is(":first-child") + +#### //判断文本中是否包含jQuery这个词 + +$().is(":contains('jQuery')") + +#### //判断是否包含某些类名 + +$().is(".select") + +#### 选择器过滤: filter() + +$().filter(selector or fn) + +#### has():过滤子代元素 + +#### parent():找直接父级 + +#### parents():找所有父级() + +#### children()方法只能查找子元素,不能查找其他后代元素 + +### $().siblings('p') :查找所有兄弟元素 \ No newline at end of file -- Gitee