博客
关于我
jQuery常用事件方法——mouseenter、mouseleave、hover方法
阅读量:326 次
发布时间: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二维数组转换为一维数组
查看>>
PHP二维数组重组
查看>>
PHP交换两个变量值
查看>>
php代码执行完整流程介绍
查看>>
PHP代码格式化工具phpcf常见问题解决方案
查看>>
PHP使用3DES算法加密解密字符串
查看>>
PHP使用curl multi要注意的问题:每次使用curl multi同时并发多少请求合适
查看>>
php使用memcached扩展的一个BUG
查看>>
PHP入门part1
查看>>
PHP兼容性检查,PHP升级语法检查(PHPCompatibility+PHP_CodeSniffer)
查看>>
PHP内核介绍及扩展开发指南—基础知识
查看>>
php内核基础说明
查看>>
PHP写日志fwrite和file_put_contents的区别与性能
查看>>
PHP写计划任务
查看>>
PHP出现Notice: unserialize() [function.unserialize]: Error at offset问题的解决方案
查看>>
PHP函数
查看>>
React input defaultValue不会更新状态怎么办?
查看>>
PHP函数__autoload失效原因(与smarty有关)
查看>>
PHP函数判断移动端和PC端
查看>>
Springboot基础入门
查看>>