16 lines
598 B
Markdown
16 lines
598 B
Markdown
---
|
||
title: jQuery Hover Method
|
||
localeTitle: jQuery悬停方法
|
||
---
|
||
# jQuery悬停方法
|
||
|
||
jquery悬停方法是`mouseenter`和`mouseleave`事件的组合。 语法是这样的:
|
||
```
|
||
$(selector).hover(inFunction, outFunction);
|
||
```
|
||
|
||
第一个功能,inFunction,当将要运行`mouseenter`事件发生。 第二个函数是可选的,但会在`mouseleave`事件发生时运行。 如果只指定了一个函数,则另一个函数将同时针对`mouseenter`和`mouseleave`事件运行。
|
||
|
||
### 更多信息
|
||
|
||
更多信息可以在[这里](https://www.w3schools.com/jquery/event_hover.asp)找到。 |