Created
April 23, 2018 23:54
-
-
Save pavel-one/911cf92c136457a0a829f8eb0a1738d2 to your computer and use it in GitHub Desktop.
preloader
This file contains 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
function preloader(show) { | |
var template = '<div class="preloader" style="position: fixed;width: 100%;height: 100%;background: rgba(255,255,255,0.45);top: 0;left: 0;z-index: 99999;display: flex;justify-content: center;align-items: center;"><img src="preloader.svg"><div>'; | |
if (show) { | |
$(template).appendTo('body'); | |
return; | |
} | |
$(document).find('.preloader').remove(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment