Created
April 13, 2015 09:03
-
-
Save rendfall/fd81bfcedb8bfa5ed9a0 to your computer and use it in GitHub Desktop.
Preloader helper
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
| var getPreloader = function(dest, options){ | |
| options = $.extend({ | |
| alt: '', | |
| css: { | |
| display: 'block', | |
| margin: '30px auto' | |
| }, | |
| src: '/assets/ajax_loaders/loader-big.gif' | |
| }, options); | |
| var $img = $('<img>', options); | |
| if(dest && dest.length){ | |
| dest.html($img); | |
| return true; | |
| } else { | |
| // return as string | |
| return $img[0].outerHTML; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment