Created
October 17, 2011 18:54
-
-
Save eveevans/1293455 to your computer and use it in GitHub Desktop.
// plugin para indicador de cargando
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
// 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