Skip to content

Instantly share code, notes, and snippets.

@anak10thn
Forked from jjaramillo/jqloader.debug.js
Created May 12, 2013 08:25
Show Gist options
  • Save anak10thn/5562846 to your computer and use it in GitHub Desktop.
Save anak10thn/5562846 to your computer and use it in GitHub Desktop.
(function ($) {
$.fn.ajaxloader = function () {
var ajaxloader = $('<div class="Ajax-Loader"><div class="Ajax-Loader-Overlay"></div><div class="Ajax-Loader-Image ui-corner-all"><img src="DesktopModules/DondeCompro/UI/recursos/img/loadinfo.net.gif"/></div></div>');
this.after(ajaxloader);
ajaxloader.css('top', this.position().top).width(this.outerWidth()).height(this.outerHeight());
ajaxloader.find('.Ajax-Loader-Overlay').css('opacity', 0.5).width(this.outerWidth()).height(this.outerHeight());
ajaxloader.find('.Ajax-Loader-Image').css('top', -((ajaxloader.height() / 2) + 36));
ajaxloader.hide();
return ajaxloader;
};
})(jQuery);
.Ajax-Loader {
position: absolute;
z-index: 9999;
}
.Ajax-Loader .Ajax-Loader-Overlay {
background-color: black;
}
.Ajax-Loader .Ajax-Loader-Image {
background-color: black;
width: 72px;
height: 72px;
margin: 0 auto;
position: relative;
}
.Ajax-Loader .Ajax-Loader-Image img {
display: block;
padding: 12px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment