JQuery的hover监听事件的使用
参考地址:
https://www.runoob.com/jquery/event-hover.html
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>hover监听事件</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> </head> <body> <div> <p class="sort">计算机</p> <p class="sort">网络工程</p> <p class="sort">Java</p> </div> <script> $(document).ready(function(){ $(".sort").hover(function(){ $(this).css("background-color","yellow"); },function(){ $(this).css("background-color","white"); }); }); </script> </body> </html>
最后
以上就是要减肥灯泡最近收集整理的关于JQuery的hover监听事件的使用的全部内容,更多相关JQuery内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复