File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1212I suggest you to use [ jspm] ( http://jspm.io/ ) as your package manager.
1313
1414``` js
15- import $ from " jquery" ;
1615import PointerLock from " jspointerlock" ;
1716
18- const element = document .body ;
19- const pointerLock = new PointerLock (element);
17+ const pointerLock = new PointerLock (document .body );
2018
2119pointerLock .on (" change" , (isLocked ) => {
2220 console .log (` pointer is ${ isLocked ? ' locked' : ' not locked' } ` );
2321});
2422
25- $ ( element). on (" click" , () => {
23+ pointerLock . element . addEventListener (" click" , () => {
2624 pointerLock .requestPointerLock ();
2725});
2826```
@@ -42,6 +40,7 @@ Please checkout the [index-dist.html](https://ardean.github.io/jsPointerLock/ind
4240 - ** Static Members**
4341 - _ exitPointerLock()_ => ** Void**
4442 - ** Properties**
43+ - _ element_ => ** Element**
4544 - _ isLocked_ => ** Boolean**
4645 - ** Static Properties**
4746 - _ isSupported_ => ** Boolean**
You can’t perform that action at this time.
0 commit comments