-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a bit more helpful details on how to use the event handler attr…
…ibutes
- Loading branch information
1 parent
b92782f
commit 1d54736
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
# Proximity Sensors | ||
|
||
This is a reference implementation of the W3C's Proximity Sensor related specifications, namely: | ||
|
||
* [Proximity Events](http://dvcs.w3.org/hg/dap/raw-file/tip/proximity/Overview.html) | ||
This is a reference implementation of the W3C's [Proximity Events](http://dvcs.w3.org/hg/dap/raw-file/tip/proximity/Overview.html) specification. It can also be used as a polyfill. | ||
|
||
# Using for testing | ||
|
||
Just do this and you are good to go: | ||
|
||
* window.addEventListener('deviceproximity', function(e) { ... }) | ||
* window.addEventListener('userproximity', function(e) { ... }) | ||
|
||
Alternatively: | ||
|
||
* window.ondeviceproximity = function(e){ ... } | ||
* window.onuserproximity = function(e){ ... } | ||
|
||
|
||
Enjoy! | ||
|
||
# Using as polyfill or with Node.js | ||
Depending on what you want to do, you can remove the "FakeSensor" and replace it with a real sensor (so long as you use the same method names). | ||
|