Last active
August 29, 2015 14:21
-
-
Save dima-f1/6eb6f6adde5465d7cf0d to your computer and use it in GitHub Desktop.
Revisions
-
dima-f1 revised this gist
May 25, 2015 . No changes.There are no files selected for viewing
-
dima-f1 created this gist
May 25, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <style> @import url(http://fonts.googleapis.com/css?family=НАЗВАНИЕ_ШРИФТА&subset=cyrillic,latin); /* шрифт по умолчанию, до тех пор пока не подгружен новый шрифт */ body {font-family: sans-serif;} /* новый шрифт */ .fontOneLoad body { font-family: 'НАЗВАНИЕ_ШРИФТА', cursive; } </style> <script src='js/fontfaceobserver.js'></script> <script> // инициализация var fontOneLoad = new FontFaceObserver('НАЗВАНИЕ_ШРИФТА', {}); fontOneLoad .check() .then(function () { // событие, когда шрифт загружен // добавляем класс тегу html document.documentElement.className += " fontOneLoad"; }); </script>