Created
August 28, 2015 22:33
-
-
Save goldhand/1343020bc0479fb9bd20 to your computer and use it in GitHub Desktop.
Load screen helper for OMD. If
This file contains hidden or 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
// <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