博客
关于我
jQuery常用事件方法——mouseenter、mouseleave、hover方法
阅读量:327 次
发布时间:2019-03-04

本文共 1339 字,大约阅读时间需要 4 分钟。

jQuery?????Web??????????????????????????????????jQuery????????????

jQuery?????????

jQuery??????? JavaScript ??????????? jQuery ?????????????? JS???? "on" ???????????????????

??????

1. Mouse Enter ? Mouse Leave

  • mouseenter() ?????????????????
  • mouseleave() ?????????????????

?????mouseenter ? mouseleave ?????????????????????????????????????????????????????????? mouseover ? mouseout?

2. Code Comparison - mouseenter ? mouseleave

??????????? mouseenter ? mouseleave ???

$box.mouseenter(function() {    console.log("box mouse in");});$box.mouseleave(function() {    console.log("box mouse out");});$parent.mouseenter(function() {    console.log("parent mouse in");});$parent.mouseleave(function() {    console.log("parent mouse out");});

3. mouseover ? mouseout

?????????????????????????????? mouseover ? mouseout ???

$box.mouseover(function() {    console.log("box mouse in");});$box.mouseout(function() {    console.log("box mouse out");});$parent.mouseover(function() {    console.log("parent mouse in");});$parent.mouseout(function() {    console.log("parent mouse out");});

4. hover() ??

hover() ???? mouseenter ? mouseleave ????????????????????????????????????

$box.hover(function() {    $box.addClass("big");}, function() {    $box.removeClass("big");});

??

??????????????? jQuery ???????????????????????????????????????????????????????

转载地址:http://ojgq.baihongyu.com/

你可能感兴趣的文章
PHP获取curl传输进度
查看>>
PHP获取IP所在地区(转)
查看>>
PHP获取IP的方法对比
查看>>
php获取json里面内容
查看>>
R2的版本由来
查看>>
PHP获取图片宽度高度、大小尺寸、图片类型、用于布局的img属性
查看>>
PHP获取当前时间、时间戳的各种格式写法汇总
查看>>
PHP获取当前页面的完整URL
查看>>
php获取文件夹中文件的两种方法
查看>>
PHP获取日期的一些方法总结
查看>>
R2学习记录
查看>>
PHP获取本周的每一天的时间
查看>>
php获取网页内容的三种方法
查看>>
R-CNN算法优化策略
查看>>
PHP规范PSR0和PSR4的理解
查看>>
php解析ipa包,获取logo
查看>>
php设置socket超时时间
查看>>
php设计模式 萨莱 pdf,PHP设计模式 建造者模式
查看>>
php设计模式之装饰器模式
查看>>
R&Python Data Science系列:数据处理(5)--字符串函数基于R(一)
查看>>