Skip to content

Instantly share code, notes, and snippets.

@goldhand
Created August 28, 2015 22:33
Show Gist options
  • Save goldhand/1343020bc0479fb9bd20 to your computer and use it in GitHub Desktop.
Save goldhand/1343020bc0479fb9bd20 to your computer and use it in GitHub Desktop.
Load screen helper for OMD. If
// <script type="text/javascript"> // remove the first two backslashes if pasting this into html
$(document).ready(function() { // document ready function
function loadScreenSafty() {
// Removes the loading class incase the library fails
var MILLISECONDS_FOR_LOAD_SCREEN_TO_FAIL = 5000; // change this to change delay time
function disableLoadScreens() {
var className = 'ac-hidden-until-ready'; // removes this class as its a theme's "loading" class and has various loading css associated with it
$('.' + className).removeClass(className);
}
function timeoutLoadScreens(timeMs) {
var timeoutId = window.setTimeout(disableLoadScreens, [timeMs,]);
return timeoutId;
}
return timeoutLoadScreens(MILLISECONDS_FOR_LOAD_SCREEN_TO_FAIL);
}
loadScreenSafty();
}());
// </script> // remove the first two backslashes if pasting this into html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment