You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
792 B

2 years ago
(function ($) {
$.fn.showloading = function () {
var loading = this.children(".loading");
if (loading.length) {
loading.show();
} else {
addLoadingDOM(this);
}
return this;
};
$.fn.hideloading = function () {
var loading = this.children(".loading");
if (loading.length) {
loading.hide();
} else {
}
return this;
};
function addLoadingDOM($this) {
$this.css("position", "relative");
var html =
'<div class="loading" style="position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;display:flex;justify-content:center;align-items:center;background-color: rgba(0,0,0,0.5);">';
html += '<img width="50px" height="50px" src="images/load.gif">';
html += "</div>";
$this.append(html);
}
})(jQuery);