Skip to content

Commit

Permalink
Added a bit more helpful details on how to use the event handler attr…
Browse files Browse the repository at this point in the history
…ibutes
  • Loading branch information
marcoscaceres-remote committed May 25, 2012
1 parent b92782f commit 1d54736
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
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).

0 comments on commit 1d54736

Please sign in to comment.