复制代码 代码如下:
//按钮注册加载样式事件
var ItSelfButton;
var ControlRegPostResult = true;
function AddInputClick() {
$("input[type='submit']").click(function () {
ItSelfButton = $(this);
if (ItSelfButton.attr("repeat") == null) {
var btnDiv = $("<div>");
btnDiv.attr("id", "Mask_BTN");
var divimg = $("<img>");
divimg.attr("alt", "加载中...");
divimg.attr("src", "/Images/ButtonLoading.gif");
divimg.css({ "margin-left": ($(this).width() - 4) / 2, "margin-top": ($(this).height() - 16) / 2 });
btnDiv.append(divimg);
btnDiv.css({ width: $(this).width() + 12 + "px", height: $(this).height() + "px", top: $(this).offset().top + "px", left: $(this).offset().left + "px", position: "absolute" });
$(document.body).append(btnDiv);
setTimeout(MaskTimeOutRemove, 200);
}
});
}
$(function () {
AddInputClick();
});
$(window).resize(function () {
if (ItSelfButton != null) {
$("#Mask_BTN").css({ top: ItSelfButton.offset().top + "px", left: ItSelfButton.offset().left + "px" });
}
});
function MaskRemove() {
$("#Mask_BTN").remove();
}
function MaskTimeOutRemove() {
if (!ControlRegPostResult) {
$("#Mask_BTN").remove();
ControlRegPostResult = true;
}
}
复制代码 代码如下:
ControlRegPostResult = false;
新闻热点
疑难解答
图片精选