Skip to content

Instantly share code, notes, and snippets.

@ivolivares
Forked from shazron/ios7.phonegap.cordova.js
Created October 14, 2013 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivolivares/6972857 to your computer and use it in GitHub Desktop.
Save ivolivares/6972857 to your computer and use it in GitHub Desktop.
// Pre-requisites:
// 1. Device core plugin
// 2. Splashscreen core plugin (3.1.0)
// 3. config.xml: <preference name="AutoHideSplashScreen" value="false" />
// 4. config.xml: <preference name="DisallowOverscroll" value="true" />
function onDeviceReady() {
if (parseFloat(window.device.version) >= 7.0) {
document.body.style.marginTop = "20px";
// OR do whatever layout you need here, to expand a navigation bar etc
}
navigator.splashscreen.hide();
}
document.addEventListener('deviceready', onDeviceReady, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment