Skip to content

Instantly share code, notes, and snippets.

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();
}