Go to: JS to get the mouse position

Source: Internet
Author: User

From: http://sofish.de/1498

Everything about location and height is especially troublesome in JS. Fortunately, for some reason, there are few places to use. This has also become an excuse for not understanding. Come back tonight to take a look at the book. Let's take a look at the compatible way to get the mouse position.

Although Javascript is not as difficult as CSS, compatibility has always been the most uncomfortable. Fortunately, there are PPK teachers and Google teachers. To put it simply, streamline it into this table:

Attribute Reference Point Browser compatibility
ClientX, ClientY Document IE
PageX, PageY Window Sane browsers
Other LayerX, LayerY, OffsetX, OffsetY, ScreenX, ScreenY, x, and y are flat clouds.

Then, let's look at another Demo: Click here to click here! (Place your mouse on the page and drag it out)

 

================

Okay, this is a split line. In fact, I have always wanted to write a blog. However, sometimes wasu network is not powerful, and the editor is not powerful. MB. I cannot write it. It took a long time to get a blog and write hundreds of words. Really, RP, looks, float cloud. SHIT.

In other words, we have gained a lot recently. However, I am busy at the company during the day and come back late at night. Many of the shares are also biased towards sending tweets. My blog ignored her day by day. In fact, this is not feasible.

I feel that young people should write more (even if they are older). The results of writing and thinking are always very different. As PPK said, write down and share, so that he can gain a lot. Yes, especially when writing a DEMO. In order to be worthy of the readers, it is necessary to test in many aspects. In fact, I have accumulated a lot of experience for myself. Maybe you are the same.

Teenagers. Write it down when you are free.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.