Skip to content

Instantly share code, notes, and snippets.

@joshje
Created October 30, 2012 11:36
Show Gist options
  • Save joshje/3979740 to your computer and use it in GitHub Desktop.
Save joshje/3979740 to your computer and use it in GitHub Desktop.

Revisions

  1. joshje renamed this gist Oct 30, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. joshje created this gist Oct 30, 2012.
    37 changes: 37 additions & 0 deletions fontloading.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <script>
    function async(url) {
    var a = document.createElement('script');
    a.async = true;
    a.src = url;
    var b = document.getElementsByTagName('script')[0];
    b.parentNode.insertBefore(a, b);
    }
    (function() {
    var htmlEl = document.getElementsByTagName('html')[0];
    htmlEl.className += ' js wf-loading';
    setTimeout(function() {
    htmlEl.className = htmlEl.className.replace(' wf-loading', '');
    }, 2000);
    WebFontConfig = {
    fontdeck: { id: 000000 }
    }
    async('http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js');
    })();
    </script>
    <style>
    body {
    background: grey;
    }
    .wf-loading body {
    visibility: hidden;
    }
    </style>
    </head>
    <body>
    Testing testing
    </body>
    </html>