Currently, many website analysis systems need to obtain mouse coordinates and tracks to draw cloud maps and mouse tracks, which requires that the mouse coordinates must be accurate. But it is difficult to be accurate. For example, when a user opens the Baidu homepage and clicks the website font in different browser sizes, the coordinates are completely inconsistent... SyntaxHighlighter. all ();
Currently, many website analysis systems need to obtain mouse coordinates and tracks to draw cloud maps and mouse tracks, which requires that the mouse coordinates must be accurate. But it is difficult to be accurate.
For example:
The user opens the Baidu homepage and clicks the "website" font in different browser sizes. The coordinates are completely different. Why are the coordinates inaccurate, cloud maps, and hotspot maps accurate?
There are three uncertainties about a common website:
1. fixed width?
2. Whether to Lean to the left, right, and center
3. Adaptive size?
These three uncertainties cannot be obtained through js, so the specific values of these three parameters must be notified through the website.
Purpose: no matter the browser window size, the mouse clicking coordinates are exactly the same as those when the browser is maximized.
Coordinate offset generally does not take the Y axis coordinates into account, so the code is only applicable to the X axis.
Js Code