Home  >  Article  >  Web Front-end  >  How to get mouse position with jQuery

How to get mouse position with jQuery

coldplay.xixi
coldplay.xixiOriginal
2020-12-03 14:48:006002browse

The jQuery method of obtaining the mouse position: first bind pageX and pageY to the event; then display the position information of X and Y in [

]; then save the file to view the display; finally in the document Just click the location information displayed after clicking the cursor.

How to get mouse position with jQuery

The operating environment of this tutorial: windows7 system, jquery3.2.1 version, Dell G3 computer.

jQuery method of obtaining mouse position:

1, e.pageX and e.pageY

How to get mouse position with jQuery

2 , pageX and pageY must be bound to events

How to get mouse position with jQuery

##3. Get the position information of the X and Y axes when the cursor is clicked

How to get mouse position with jQuery

4. Let the location information of

#6. The position information displayed after clicking the cursor in the document

How to get mouse position with jQuery

Related free learning recommendations:How to get mouse position with jQueryjavascript

(Video)

The above is the detailed content of How to get mouse position with jQuery. 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