Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the jquery mouse operation function?

Shulou Source: shulou.com Published: 2022-06-01 03:56:05 09月10日 Update

Most people do not understand the knowledge points of this article "what is the jquery mouse operation function?", so the editor summarizes the following, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what is the jquery mouse operation function" article.

Mouse operation functions are: 1, click (), operation click event; 2, dblclick (), operation double click event; 3, hover (), operation mouse enter and move out event; 4, mousedown (), operation press mouse button event; 5, mouseup (); 6, toggle (), and so on.

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

What needs mouse operation is the mouse event, which is the most commonly used event in DOM events. JQuery encapsulates and extends mouse events.

The type of mouse event

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

Click triggers an event that contextmenu can cancel when the user presses and releases the mouse button or other means to "activate" the element, and when the context menu is about to appear. The current browser displays the context menu dblclick when the mouse is right-clicked, mousedown is triggered when the user double-clicks, mouseup is triggered when the user presses the mouse button, mousemove is triggered when the user releases the mouse button, mouseover is triggered when the user moves the mouse button, mouseout is triggered when the mouse enters the element, mouseenter is triggered when the mouse leaves the element, but mouseleave is similar to mouseout, but not bubbling.

Jquery mouse operation function

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

Click ()

Add / trigger click click events and bind handlers

Contextmenu ()

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

Dblclick ()

Add / trigger double click events and bind handlers

Hover ()

Triggers mouseenter and mouseleave events.

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

Two event functions are bound to the matching element and are executed when the mouse pointer enters and leaves the element, respectively. Bind a separate event function to the matching element, which is executed when the mouse pointer enters and leaves the element, respectively.

Mousedown ()

Add / trigger "mousedown" event, bind handler

Mouseenter ()

Add / trigger mouse enters (mouse entry) event to bind a handler

Mouseleave ()

Add / trigger mouse leaves (mouse away) event to bind a handler

Mousemove ()

Add / trigger "mousemove" event, bind a handler

Mouseout ()

Add / trigger "mouseout" event, bind a handler

Mouseover ()

Add / trigger "mouseover" event, bind a handler (Note: support event bubbling)

Mouseup ()

Add / trigger "mouseup" event, bind a handler

| | deprecate API that has been deprecated in version 1.8 | deleted function |

Toggle ()

Add / trigger "toggle" event, bind handler

It binds two or more handlers to matching elements to perform alternating clicks.

The above is about the content of this article on "what is the jquery mouse operation function?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Tags: Event mouse function processing element content user keystroke pointer up and down context two article version knowledge program article menu value multiple Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn MySQL Huawei Linux