Skip to content

Instantly share code, notes, and snippets.

@eveevans
Created October 17, 2011 18:54
Show Gist options
  • Save eveevans/1293455 to your computer and use it in GitHub Desktop.
Save eveevans/1293455 to your computer and use it in GitHub Desktop.
// plugin para indicador de cargando
// plugin para indicador de cargando
$.fn.showLoading = function(top, left) {
top = top || 0;
left = left || 0;
this.each(function() {
// crear indicador
var $this = $(this);
var offset = $this.offset();
offset.top += top;
offset.left += $this.width() + left;
$('<div style="position: absolute;"></div>').addClass("jqLoadingIndicator")
.html('<img src="images/loading.gif" />').offset(offset)
.insertAfter($this);
});
return this;
};
$.fn.hideLoading = function() {
this.next("div.jqLoadingIndicator").remove();
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment