Created
December 18, 2013 11:34
-
-
Save benhuson/8020919 to your computer and use it in GitHub Desktop.
Detect iPad version
http://stackoverflow.com/questions/7400489/ipad-version-detection-in-javascript/11262586#11262586
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
var ipad_version = 0; | |
window.ondevicemotion = function(event) { | |
if (navigator.platform.indexOf("iPad") != -1) { | |
ipad_version = 1; | |
if (event.acceleration) ipad_version += window.devicePixelRatio; | |
} | |
window.ondevicemotion = null; | |
get_ipad_version(); | |
} | |
setTimeout(function(){alert(ipad_version)},3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment