From a7835d41e8579668373b8130ee5f867ea52630d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Thu, 24 Nov 2022 03:15:35 +0000 Subject: [PATCH 01/11] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202022-11-13-=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022-11-13-\344\272\213\344\273\266/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-13-\344\272\213\344\273\266/.keep" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-13-\344\272\213\344\273\266/.keep" "b/47\346\233\276\345\276\267\346\243\256/2022-11-13-\344\272\213\344\273\266/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 7f2ce86501183a6300ea7a09e014f03ef1a2e00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Thu, 24 Nov 2022 03:16:46 +0000 Subject: [PATCH 02/11] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2047=E6=9B=BE?= =?UTF-8?q?=E5=BE=B7=E6=A3=AE/2022-11-13-=E4=BA=8B=E4=BB=B6=20=E4=B8=BA=20?= =?UTF-8?q?47=E6=9B=BE=E5=BE=B7=E6=A3=AE/2022-11-23-=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022-11-23-\344\272\213\344\273\266/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "47\346\233\276\345\276\267\346\243\256/2022-11-13-\344\272\213\344\273\266/.keep" => "47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/.keep" (100%) diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-13-\344\272\213\344\273\266/.keep" "b/47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/.keep" similarity index 100% rename from "47\346\233\276\345\276\267\346\243\256/2022-11-13-\344\272\213\344\273\266/.keep" rename to "47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/.keep" -- Gitee From 19f8b3bf2646bc3dbe2f2d08c6ee1a283f889912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Thu, 24 Nov 2022 03:17:05 +0000 Subject: [PATCH 03/11] =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 曾德森 <1500225483@qq.com> --- .../\344\275\234\344\270\232.html" | 30 +++++++++++ .../\344\272\213\344\273\266.md" | 51 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\344\275\234\344\270\232/\344\275\234\344\270\232.html" create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\347\254\224\350\256\260/\344\272\213\344\273\266.md" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\344\275\234\344\270\232/\344\275\234\344\270\232.html" "b/47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\344\275\234\344\270\232/\344\275\234\344\270\232.html" new file mode 100644 index 0000000..356162b --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\344\275\234\344\270\232/\344\275\234\344\270\232.html" @@ -0,0 +1,30 @@ + + + + + + + Document + + +
+ +
+ + + \ No newline at end of file diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\347\254\224\350\256\260/\344\272\213\344\273\266.md" "b/47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\347\254\224\350\256\260/\344\272\213\344\273\266.md" new file mode 100644 index 0000000..7edf826 --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-23-\344\272\213\344\273\266/\346\233\276\345\276\267\346\243\256/\347\254\224\350\256\260/\344\272\213\344\273\266.md" @@ -0,0 +1,51 @@ +## 事件 + +onclick相对function优先级更高,两个同时存在只显示onclick里的内容 + +//DOM 0:当有多个同类型事件触发时,只会触发一次 + +var btn=document.queryselector('button'); + +//点击 + +`function aler(){` + +​ `btn.onclick=function(){` + +​ `alert('全是帅哥');` //优先级更高 + +​ `btn.onclick=function(){` + +​ `alert('全是学霸');` + +`}` + +`}` + +`}` + + + +//DOM 2:当有多个同类型事件触发时,会依次触发,兼容性较差 + +`var btn=document.queryselector('button');` //选中按钮 + +//addEventLisetener('事件类型',' '); + +`btn.addEventLisetener('click','fn');` + +`function fn(){` + +​ `alert('2班');` + +`}` + +`btn.addEventLisetener('click',function(){` + +​ `alert('3班');` + +`});` + +//事件取消 + +`btn.removeEventListener('click',fn);` \ No newline at end of file -- Gitee From 10bcaa5970cbf8de092d41211bf79c71144dc6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 07:12:56 +0000 Subject: [PATCH 04/11] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202022-11-24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "47\346\233\276\345\276\267\346\243\256/2022-11-24/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-24/.keep" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-24/.keep" "b/47\346\233\276\345\276\267\346\243\256/2022-11-24/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From cd65a3ec35c1842d2852f388d259cc28cc6b7159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 07:13:38 +0000 Subject: [PATCH 05/11] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2047=E6=9B=BE?= =?UTF-8?q?=E5=BE=B7=E6=A3=AE/2022-11-24=20=E4=B8=BA=2047=E6=9B=BE?= =?UTF-8?q?=E5=BE=B7=E6=A3=AE/2022-11-24-jQuery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022-11-24-jQuery/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "47\346\233\276\345\276\267\346\243\256/2022-11-24/.keep" => "47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/.keep" (100%) diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-24/.keep" "b/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/.keep" similarity index 100% rename from "47\346\233\276\345\276\267\346\243\256/2022-11-24/.keep" rename to "47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/.keep" -- Gitee From 506b295b63f92a3051ad8a7ba5a8d82694b7ec21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 07:43:19 +0000 Subject: [PATCH 06/11] =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 曾德森 <1500225483@qq.com> --- .../\344\275\234\344\270\232.html" | 39 ++++++++ .../\347\254\224\350\256\260.md" | 93 +++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\344\275\234\344\270\232.html" create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\347\254\224\350\256\260.md" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\344\275\234\344\270\232.html" "b/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\344\275\234\344\270\232.html" new file mode 100644 index 0000000..e84d6c6 --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\344\275\234\344\270\232.html" @@ -0,0 +1,39 @@ + + + + + + + + Document + + + +
+ 狗 + 猫 + 鼠 +
+

+ + + + \ No newline at end of file diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\347\254\224\350\256\260.md" "b/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\347\254\224\350\256\260.md" new file mode 100644 index 0000000..6b37176 --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery/\347\254\224\350\256\260.md" @@ -0,0 +1,93 @@ +# jQuery + +jQuery是一个javaScript库极大的简化了JavaScript编程 + +#### jQuery语法 + +jQuery语法是通过选取HTML元素,并对选取的元素执行某些操作 + +基础语法: + +`$(selectot).action()` + +美元符号定义jQuery + +选择符(selectot)“查询”和“查找”HTML元素 + +jQuery的action()执行对元素的操作 + +`$(this),hide()` //隐藏当前元素 + +`$("p").hide()` //隐藏所有

元素 + +`$("p.test").hide()` //隐藏所有class="test"的元素: + +`$("p")` + +用户点击按钮后,所有

元素隐藏: + +`$(function(){` + +​ `$("button").click(function(){` + +​ `$("p").hide();` + +`});` + +`});` + +##### #id选择器 + +通过id选取元素语法: + +$("#test") + +用户点击按钮后有id="test"属性的元素将被隐藏 + +`$(function(){` + +​ `$("button").click(function(){` + +​ `$("test").hide();` + +`});` + +`});` + +##### class选择器 + +通过class选择: + +`$(".test")` + +用户点击按钮所有的class="test"属性的元素都隐藏: + +`$(function(){` + +​ `$("button").click(function(){` + +​ `$(".test").hide();` + +`});` + +`});` \ No newline at end of file -- Gitee From 4f1bac1d4cf192bdb4010fd51a28e54b75c02e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 07:47:55 +0000 Subject: [PATCH 07/11] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202022-11-24-jQuery?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022-11-24-jQuery\351\200\211\346\213\251\345\231\250/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery\351\200\211\346\213\251\345\231\250/.keep" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery\351\200\211\346\213\251\345\231\250/.keep" "b/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery\351\200\211\346\213\251\345\231\250/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From bc4b6006e9cd2d918f9b9d672468408888d3447a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 07:48:09 +0000 Subject: [PATCH 08/11] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2047=E6=9B=BE?= =?UTF-8?q?=E5=BE=B7=E6=A3=AE/2022-11-24-jQuery=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=20=E4=B8=BA=2047=E6=9B=BE=E5=BE=B7=E6=A3=AE/2022-11-25-jQuery?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery\351\200\211\346\213\251\345\231\250/.keep" => "47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/.keep" (100%) diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery\351\200\211\346\213\251\345\231\250/.keep" "b/47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/.keep" similarity index 100% rename from "47\346\233\276\345\276\267\346\243\256/2022-11-24-jQuery\351\200\211\346\213\251\345\231\250/.keep" rename to "47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/.keep" -- Gitee From 0421efbf859f241202bdd510a7e9be16d0794ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 07:48:33 +0000 Subject: [PATCH 09/11] =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 曾德森 <1500225483@qq.com> --- .../\344\275\234\344\270\232.html" | 32 +++++++ .../\347\254\224\350\256\260.md" | 93 +++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\344\275\234\344\270\232.html" create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\347\254\224\350\256\260.md" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\344\275\234\344\270\232.html" "b/47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\344\275\234\344\270\232.html" new file mode 100644 index 0000000..513b935 --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\344\275\234\344\270\232.html" @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + +
第一行第一行
第二行第二行
第三行第三行
第四行第四行
第五行第五行
+ + \ No newline at end of file diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\347\254\224\350\256\260.md" "b/47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\347\254\224\350\256\260.md" new file mode 100644 index 0000000..6b37176 --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-25-jQuery\351\200\211\346\213\251\345\231\250/\347\254\224\350\256\260.md" @@ -0,0 +1,93 @@ +# jQuery + +jQuery是一个javaScript库极大的简化了JavaScript编程 + +#### jQuery语法 + +jQuery语法是通过选取HTML元素,并对选取的元素执行某些操作 + +基础语法: + +`$(selectot).action()` + +美元符号定义jQuery + +选择符(selectot)“查询”和“查找”HTML元素 + +jQuery的action()执行对元素的操作 + +`$(this),hide()` //隐藏当前元素 + +`$("p").hide()` //隐藏所有

元素 + +`$("p.test").hide()` //隐藏所有class="test"的元素: + +`$("p")` + +用户点击按钮后,所有

元素隐藏: + +`$(function(){` + +​ `$("button").click(function(){` + +​ `$("p").hide();` + +`});` + +`});` + +##### #id选择器 + +通过id选取元素语法: + +$("#test") + +用户点击按钮后有id="test"属性的元素将被隐藏 + +`$(function(){` + +​ `$("button").click(function(){` + +​ `$("test").hide();` + +`});` + +`});` + +##### class选择器 + +通过class选择: + +`$(".test")` + +用户点击按钮所有的class="test"属性的元素都隐藏: + +`$(function(){` + +​ `$("button").click(function(){` + +​ `$(".test").hide();` + +`});` + +`});` \ No newline at end of file -- Gitee From 41197b2d8128f80d88d533e1509d358a3076f9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 07:49:04 +0000 Subject: [PATCH 10/11] =?UTF-8?q?=E6=96=B0=E5=BB=BA=202022-11-28-jQuery?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022-11-28-jQuery\344\272\213\344\273\266/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/.keep" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/.keep" "b/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From e4cf10b075dcfb7096abdfb4ecabf3808ac53b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= <1500225483@qq.com> Date: Tue, 29 Nov 2022 08:49:06 +0000 Subject: [PATCH 11/11] =?UTF-8?q?=E6=9B=BE=E5=BE=B7=E6=A3=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 曾德森 <1500225483@qq.com> --- .../\344\275\234\344\270\232.html" | 90 +++++++++++++ .../\347\254\224\350\256\260.md" | 125 ++++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\344\275\234\344\270\232.html" create mode 100644 "47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\347\254\224\350\256\260.md" diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\344\275\234\344\270\232.html" "b/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\344\275\234\344\270\232.html" new file mode 100644 index 0000000..402ebd2 --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\344\275\234\344\270\232.html" @@ -0,0 +1,90 @@ + + + + + + + + Document + + + + +

+ 0 + 1 + 2 + 3 + +
+
+
+
+ +
+
+
+ 用户名:
+ 密 码:
+ 确认密码:
+
+
+ + + + \ No newline at end of file diff --git "a/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\347\254\224\350\256\260.md" "b/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\347\254\224\350\256\260.md" new file mode 100644 index 0000000..e2f316a --- /dev/null +++ "b/47\346\233\276\345\276\267\346\243\256/2022-11-28-jQuery\344\272\213\344\273\266/\347\254\224\350\256\260.md" @@ -0,0 +1,125 @@ +# jQuery事件 + +在事件中经常使用术语“触发” + +#### jQuery事件方法语法 + +页面中指定一个点击事件: + +`$("p").click();` + +定义了点击后触发事件,可以通过一个事件函数实现: + +`$("p").click(function(){` + +​ `//动作触发后执行的代码` + +`})` + +#### 常用的 jQuery 事件方法 + +##### click() + +click() 方法是当按钮点击事件被触发时会调用一个函数 + +当点击事件在某个

元素上触发时,隐藏当前的

元素: + +`$("p").click(function(){` + +​ `$(this).hide();` + +`});` + +##### dblclick() + +当双击元素时,会发生 dblclick 事件。 + +dblclick() 方法触发 dblclick 事件,或规定当发生 dblclick 事件时运行的函数: + +`$("p").dblclick(functipn(){` + +​ `$(this).hide();` + +`});` + +##### mouseenter() + +当鼠标指针穿过元素时,会发生 mouseenter 事件。 + +mouseenter() 方法触发 mouseenter 事件,或规定当发生 mouseenter 事件时运行的函数: + +`$("#p1").mouseenter(function(){` + +​ `aletr('你的鼠标移到了id='p1'的元素上')` + +`})` + +##### mouseleave() + +当鼠标指针离开元素时,会发生 mouseleave 事件。 + +mouseleave() 方法触发 mouseleave 事件,或规定当发生 mouseleave 事件时运行的函数: + +`$("#p1").mouseleave(function(){` + +​ `alert("再见,您的鼠标离开了该段落。");` + +`});` + +##### mousedown() + +当鼠标指针移动到元素上方,并按下鼠标按键时,会发生 mousedown 事件。 + +mousedown() 方法触发 mousedown 事件,或规定当发生 mousedown 事件时运行的函数: + +`$("#p1").mousedown(function(){` + + `alert("鼠标在该段落上按下!");` + + `});` + +##### mouseup() + +当在元素上松开鼠标按钮时,会发生 mouseup 事件。 + +mouseup() 方法触发 mouseup 事件,或规定当发生 mouseup 事件时运行的函数: + +`$("#p1").mouseup(function(){` + +​ `alert("鼠标在段落上松开。");` + +`});` + +##### hover() + +hover()方法用于模拟光标悬停事件。 + +当鼠标移动到元素上时,会触发指定的第一个函数(mouseenter);当鼠标移出这个元素时,会触发指定的第二个函数(mouseleave)。 + +`$("#p1").hover(` + +`function(){` + +​ `alert("你进入了 p1!");` + + `},` + +`function(){` + +​ `alert("拜拜! 现在你离开了 p1!");` + +​ `} );` + +##### focus() + +当元素获得焦点时,发生 focus 事件。 + +当通过鼠标点击选中元素或通过 tab 键定位到元素时,该元素就会获得焦点。 + +focus() 方法触发 focus 事件,或规定当发生 focus 事件时运行的函数: + +`$("input").focus(function(){` + +​ `$(this).css("background-color","#cccccc");` + + `});` \ No newline at end of file -- Gitee