Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A comparison of the new vs old Screen Orientation API
// Old API
screen.orientation
.lockOrientation( orientations )
.unlockOrientation()
screen.addEventListener('orientationchange', handler)
// New API
screen.orientation.type
.angle
.onchange
.lock( lockType ) // returns Promise
.unlock()
screen.orientation.addEventListener('change', handler)
@simevidas

This comment has been minimized.

Copy link
Owner Author

commented Oct 24, 2014

Old API (February 2014 draft): http://www.w3.org/TR/2014/WD-screen-orientation-20140220/
New API (October 2014 draft): http://www.w3.org/TR/2014/WD-screen-orientation-20141023/

The new API has already been implemented and enabled by default in Chrome and Opera.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.