Home  >  Article  >  Web Front-end  >  What are the jquery mouse operation functions?

What are the jquery mouse operation functions?

青灯夜游
青灯夜游Original
2022-03-23 18:55:452599browse

The mouse operation functions are: 1. click(), which operates the click event; 2. dblclick(), which operates the double-click event; 3. hover(), which operates the mouse entry and removal events; 4. mousedown() , operate the mouse button press event; 5. mouseup(); 6. toggle() and so on.

What are the jquery mouse operation functions?

The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.

What requires mouse operation is mouse events, which are the most commonly used events in DOM events. jQuery encapsulates and extends mouse events.

Types of mouse events

There are 10 types of mouse events, including click, contextmenu, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter and mouseleave

click         当用户按下并释放鼠标按键或其他方式“激活”元素时触发
contextmenu   可以取消的事件,当上下文菜单即将出现时触发。当前浏览器在鼠标右击时显示上下文菜单
dblclick      当用户双击鼠标时触发
mousedown     当用户按下鼠标按键时触发
mouseup       当用户释放鼠标按键时触发
mousemove     当用户移动鼠标时触发
mouseover     当鼠标进入元素时触发
mouseout      当鼠标离开元素时触发
mouseenter    类似mouseover,但不冒泡
mouseleave    类似mouseout,但不冒泡

jquery mouse operation function

The above 10 types of mouse events have corresponding jquery mouse operation functions.

click()

Add/trigger click click event and bind the handler function

contextmenu()

Add an event handler to the contextmenu event and bind the handler function

dblclick()

Add/trigger the double click event and bind the handler function

hover()

Trigger mouseenter and mouseleave events.

hover() method specifies two functions to be run when the mouse pointer hovers over the selected element.

Bind two event functions to the matching element, which will be executed when the mouse pointer enters and leaves the element respectively. Bind a single event function to the matching element to be executed when the mouse pointer enters and leaves the element.

mousedown()

Add/trigger the "mousedown" event and bind the handler function

mouseenter()

Add/trigger mouse enters (mouse enters) event, bind a handler function

mouseleave()

Add/trigger mouse leaves (mouse leaves) Event, bind a handler function

mousemove()

Add/trigger the "mousemove" event, bind a handler function

mouseout()

Add/trigger the "mouseout" event and bind a handler function

mouseover()

Add/trigger" mouseover" event, bind a handler (note: event bubbling is supported)

mouseup()

Add/trigger the "mouseup" event, bind a handler Function

| Deprecated > API deprecated in version 1.8 | Deleted function

toggle()

Add/trigger "toggle" event, bind handler function

It will bind two or more handlers to matching elements, used to perform alternate clicks.

[Recommended learning: jQuery video tutorial, web front-end development]

The above is the detailed content of What are the jquery mouse operation functions?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn