-1

When you open a web page is possible to limit the area of the cursor? eg 200px x 200px area.

The cursor can only navigated in this area, the cursor can not navigate to another area of ​​the screen. Assuming that the monitor has a resolution of 800 x 600, he could see the whole page, but the cursor will be limited to a simple square on the page, is there any way to do this? Is possible to CSS ? Or you need to use javascript or some property of DOM?

I look forward answer, thanks.

superuser
  • 7
  • 1
  • 6
  • 1
    This is not possible as it would create a security risk. If websites could control how your cursor moved on your machine that would potentially stop you from being able to close the browser, which is not accepted by any browser I know of. – Nunners Oct 07 '13 at 13:54
  • 1
    It would be horrible if a web site could do this. Imagine - the user would have no way to close the current page. – Pekka Oct 07 '13 at 13:55
  • Possible duplicate of http://stackoverflow.com/questions/2322603/move-cursor-in-javascript and http://stackoverflow.com/questions/4752501/move-the-mouse-pointer-to-a-specific-position –  Oct 07 '13 at 13:56

2 Answers2

0

No, this is not possible. You can not control the cursor with JavaScript in the browser

0

Good news, modern browsers catching up with the Pointer Lock API. Read more: https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API

klihelp
  • 26
  • 2
  • 1
    Could you elaborate a bit on what this does? Remember, the question could quite possibly be here longer than that page, and when that happens, your answer will be (nearly) useless. See [the faq](http://stackoverflow.com/help/how-to-answer) to help write a good answer. – James Westman Jan 16 '15 at 22:50
  • Excellent answer Klihelp, this is I´m looking for, OK. To other guys that depreciate my question, thanks too! – superuser Jan 30 '15 at 21:11
  • This is just a CR, see the browser support: https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API#Browser_compatibility and there are many things to keep in mind: http://www.w3.org/TR/pointerlock/#requirements http://www.w3.org/TR/pointerlock/#security –  Jan 31 '15 at 19:23