jquery中hover方法作用是什么
时间:2021-11-19
来源:互联网
今天PHP爱好者为您带来jquery中hover方法规定当鼠标指针悬停在被选元素上时要运行的两个函数,其使用语法是“$(selector).hover(inFunction,outFunction)”。希望对大家有所帮助。
本文操作环境:windows7系统、jquery3.2.1版、DELL G3电脑
jquery中hover方法作用是什么?
jQuery hover() 方法:
hover() 方法规定当鼠标指针悬停在被选元素上时要运行的两个函数。
方法触发 mouseenter 和 mouseleave 事件。
注意: 如果只指定一个函数,则 mouseenter 和 mouseleave 都执行它。
语法
$(selector).hover(inFunction,outFunction)
调用:
$( selector ).hover( handlerIn, handlerOut )
等同以下方式:
$( selector ).mouseenter( handlerIn ).mouseleave( handlerOut );
注意:如果只规定了一个函数,则它将会在 mouseenter 和 mouseleave 事件上运行。
调用:
$(selector).hover(handlerInOut)
等同于:
$( selector ).on( "mouseenter mouseleave", handlerInOut );
参数
inFunction 必需。规定 mouseenter 事件发生时运行的函数。
outFunction 可选。规定 mouseleave 事件发生时运行的函数。
以上就是jquery中hover方法作用是什么的详细内容,更多请关注php爱好者其它相关文章!
-
Bybit交易所提币好提吗?提币快吗? 时间:2025-05-11
-
Bybit实体卡怎么拿?怎么用?国内获取Bybit实体卡操作教程 时间:2025-05-11
-
达世币(DASH)是什么?全面解析其特点与投资价值 时间:2025-05-11
-
Bybit怎么注册?Bybit交易所注册方法 时间:2025-05-11
-
兀币官方最新消息2025 时间:2025-05-11
-
CELO币怎么挖矿?CELO币怎么样? 时间:2025-05-11
今日更新
-
jquery怎么实现全选效果
阅读:18
-
css怎么让鼠标滑过图片旋转
阅读:18
-
jquery是jsp吗
阅读:18
-
css如何固定导航栏
阅读:18
-
Win10系统下怎么将VSCode配置到右键菜单中
阅读:18
-
jquery是一门语言吗
阅读:18
-
css边框变圆角边框怎么写
阅读:18
-
embed是啥?Go怎么用它加载静态文件?
阅读:18
-
分析TP6的多应用与TP5的区别
阅读:18
-
html的a标签怎么设置字体颜色
阅读:18