freeCodeCamp/guide/chinese/jquery/jquery-hover-method/index.md

16 lines
598 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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)找到。