A new day and a new beginning. What I want to share today is to use JQuery to imitate the Dock effect of the Apple operating system desktop. The reason why it is called the junior version is because there are still some bugs in it and the display effect is not stable. Due to time constraints, these bugs have not been fixed yet. I hope that experts will give you some advice and provide better opinions. I hope that I can make a better version and share it with everyone.
This is a static rendering, okay, it looks decent
The following is the code of the HTML page:
< ;img alt="Link" src="images/link.png" />
Let’s talk about JQuery’s method of obtaining the mouse. When executing mousemove(function(e){}), the parameter e of the method provides e.pageX to obtain the horizontal coordinate and e.pageY to obtain the vertical coordinate. It can also be used var x = e.originalEvent.x || e.originalEvent.layerX || 0; Get the horizontal position of the mouse. You can also use var y = e.originalEvent.y || e.originalEvent.layerY || 0; Get the horizontal position of the mouse vertical position.
When the mouse moves slowly, the display effect is acceptable. However, when the mouse moves quickly, the icon is enlarged, but corresponding bugs also appear.
We sincerely invite all the experts and masters who have passed by to put forward your valuable suggestions for modifications and better algorithms. Thank you for watching.