When to choose mouseover() and hover() function?

后端 未结 5 1801
执念已碎
执念已碎 2020-11-27 12:25

What are the differences between jQuery .mouseover() and .hover() functions? If they are totally same why jQuery uses both?

5条回答
  •  情歌与酒
    2020-11-27 13:01

    From the offical docs: (http://api.jquery.com/hover/)

    The .hover() method binds handlers for both mouseenter and mouseleave events. You can use it to simply apply behavior to an element during the time the mouse is within the element.

提交回复
热议问题